问:
Want to Map AD field account expires with the sys_user table filed which is in Date/Time format in ServiceNow. AD account expires field is in C#
I am unable to resolve this since few days,

I want to calculate when an users account will expires, Coming from AD.

I want a script to calculate when users account will expire and Map it in sys_user table field u_acc_expire.

I'm using this OnBefore Transform script but still not getting results

```<code>// Updates the SN Account Expires field
var n = source.u_accountexpires;
var s = n.toString();

// Only convert AD accountExpires values that begin with 1 (ex. 0 represents never expires)
if (s.charAt(0) == 1) {
    var dtUtil = new DateTimeUtils();
    var gDate = dtUtil.int8ToGlideDateTime(n);
    gDate.addDaysLocalTime(-1);
    target.u_account_expiration = gDate;
}else if(!target.u_account_expiration.nil()) {
    target.u_account_expiration = '';
}
</code>```

Body:
I am unable to resolve this since few days,

I want to calculate when an users account will expires, Coming from AD.

I want a script to calculate when users account will expire and Map it in sys_user table field u_acc_expire.

I'm using this OnBefore Transform script but still not getting results

// Updates the SN Account Expires field
var n = source.u_accountexpires;
var s = n.toString();

// Only convert AD accountExpires values that begin with 1 (ex. 0 represents never expires)
if (s.charAt(0) == 1) {
    var dtUtil = new DateTimeUtils();
    var gDate = dtUtil.int8ToGlideDateTime(n);
    gDate.addDaysLocalTime(-1);
    target.u_account_expiration = gDate;
}else if(!target.u_account_expiration.nil()) {
    target.u_account_expiration = '';
}


来源: stackexchange

问:
how do i change player 1 text when i press 1, 2, 3 ? to player has chosen
so im trying to make it when player 1 can choose it changes it text when the player has chosen 1, 2, 3 but its not really working

this is part of my html

and it is about player one that i gave a id of choose1

```<code>        <div class="row">
            <div class="col-md-offset-2 col-md-8">
                <div class="jumbotron multiGame">
                    <h2 id="choose1">Player 1 Selected: <span style="color: #eee;" id="player1"></span></h2>
                    <h2>Player 2 selected <span id="player2"></span></h2>
                    <h2 id="roundScore"></h2>
                    <div class="messageBox"></div>
                </div>
            </div>
        </div>
</code>```

this is my javascript its only part of the code btw.

```<code>
    document.onkeyup = function(event) {
        console.log($(".lock").text());
        console.log($(".round").text());
        if($(".lock").text() === $(".round").text()){
            switch(event.key){
                case '1':
                    userText.textContent = 'rock';
                break;
                case '2':
                    userText.textContent = 'paper';
                break;
                case '3':
                    userText.textContent = 'scissors';
                break;
            }
            var player1selection = document.getElementById("player1").innerText
            if(event.key ===  '1' || '2' || '3'){
                userSelection('player2');
                var player2selection = document.getElementById("player2").innerText;
                turn[0] = player1selection;
                turn[1] = player2selection;
                bestOfThree.push(turn);
                console.log(turn);
                score(player1selection, player2selection);
                trackScore();
                console.log();
                if(!(turn[0] === "") && !(turn[1] === "")){
                    console.log('reset');
                    var nextRound = $(".lock").text(Number($(".lock").text()) + 1);
                    $(".messageBox").append("<button class='reset' >Start the next round?</button>");
                    reset();
                }
            }
        }
    }
};
</code>```

im trying to make it when the player1 presses 1 2 or 3 it changes the text from Player 1 Selected: to player one has chosen. but im not sure what to do

ContentLicense: CC BY-SA 4.0

Body:
so im trying to make it when player 1 can choose it changes it text when the player has chosen 1, 2, 3 but its not really working

this is part of my html

and it is about player one that i gave a id of choose1

Player 1 Selected:

Player 2 selected

this is my javascript its only part of the code btw.

    document.onkeyup = function(event) {
        console.log($(".lock").text());
        console.log($(".round").text());
        if($(".lock").text() === $(".round").text()){
            switch(event.key){
                case '1':
                    userText.textContent = 'rock';
                break;
                case '2':
                    userText.textContent = 'paper';
                break;
                case '3':
                    userText.textContent = 'scissors';
                break;
            }
            var player1selection = document.getElementById("player1").innerText
            if(event.key ===  '1' || '2' || '3'){
                userSelection('player2');
                var player2selection = document.getElementById("player2").innerText;
                turn[0] = player1selection;
                turn[1] = player2selection;
                bestOfThree.push(turn);
                console.log(turn);
                score(player1selection, player2selection);
                trackScore();
                console.log();
                if(!(turn[0] === "") && !(turn[1] === "")){
                    console.log('reset');
                    var nextRound = $(".lock").text(Number($(".lock").text()) + 1);
                    $(".messageBox").append("<button class='reset' >Start the next round?</button>");
                    reset();
                }
            }
        }
    }
};

im trying to make it when the player1 presses 1 2 or 3 it changes the text from Player 1 Selected: to player one has chosen. but im not sure what to do


问:
remove signature or certificate from PDF files
i'm trying to remove a signature or a certificate from the PDF throught automation. I'm having thousands of PDF files which are signed and i'm converting them into HTML to preserve the layout when extracting text. One issue i'm facing is the signature withing the PDFs convert along with other texts so it's hard for me to parse them in the front-end.

signature example

The code i'm using for automation:

```<code>AvDoc = Dispatch("AcroExch.AVDoc")
if AvDoc.Open(to_convert.pdf, ""):
    pdDoc = AvDoc.GetPDDoc()
    jsObject = pdDoc.GetJSObject()
    jsObject.SaveAs(filename+ ".html", "com.adobe.acrobat.html")
</code>```

The result i'm getting, when i open the HTML page:
signature in the output PDF

this little signature is disrupting the entire flow when parsing text. Any suggestions?

one solution on the GUI is to right-click on the file and click on the combine option and saving it. But it isn't possible for me in the automation flow.

Body:
i'm trying to remove a signature or a certificate from the PDF throught automation. I'm having thousands of PDF files which are signed and i'm converting them into HTML to preserve the layout when extracting text. One issue i'm facing is the signature withing the PDFs convert along with other texts so it's hard for me to parse them in the front-end.

signature example

The code i'm using for automation:

AvDoc = Dispatch("AcroExch.AVDoc")
if AvDoc.Open(to_convert.pdf, ""):
    pdDoc = AvDoc.GetPDDoc()
    jsObject = pdDoc.GetJSObject()
    jsObject.SaveAs(filename+ ".html", "com.adobe.acrobat.html")

The result i'm getting, when i open the HTML page:
signature in the output PDF

this little signature is disrupting the entire flow when parsing text. Any suggestions?

one solution on the GUI is to right-click on the file and click on the combine option and saving it. But it isn't possible for me in the automation flow.


问:
AO map texture not mapping correctly on fbx model in threeJS
When I am integrate AO map by threeJS is not reflecting properly in the model . When we are setting it up in unity it is reflecting correctly . What possible error that I might be making in mapping or coding ?

I tried to Integrate AO map through coding but it is not reflecting on model


问:
Mongoose: Argument of type '"save"' is not assignable to parameter of type 'RegExp | "insertMany"'
I am working on user model with mongoose. Created some interfaces for using both model methods and statics as in documentation.

```<code>export interface IUser extends Document {
  email: string;
  password: string;
  role: 'user' | 'admin';
  firstname: string;
  lastname: string;
  age: number;
  date: Date;
  verified: boolean;
}
interface IUserMethods { // no methods now, interface for future

}
interface UserModel extends Model<IUser, {}, IUserMethods> {
    emailTaken(email: string): Promise<HydratedDocument<IUser, IUserMethods>>;
}
</code>```

Then created the schema, using all interfaces

```<code>const userSchema = new Schema<IUser, UserModel, IUserMethods>({...});
</code>```

Then I'm trying to use pre-save hook to hash password, and I get this error:

Argument of type '"save"' is not assignable to parameter of type 'RegExp | "insertMany"'

```<code>userSchema.pre('save', async function (next: NextFunction) {
    const user = this;

    if (user.isModified('password')) {
      const salt = await bcrypt.genSalt(10);
      const hash = await bcrypt.hash(user.password, salt);
    }

    next();
  });
</code>```

I've tried and .pre<IUser> and .pre<HydratedDocument<IUser>> and .pre<HydratedDocument<IUser, IUserMethods>>, but none has worked.

Body:
I am working on user model with mongoose. Created some interfaces for using both model methods and statics as in documentation.

export interface IUser extends Document {
  email: string;
  password: string;
  role: 'user' | 'admin';
  firstname: string;
  lastname: string;
  age: number;
  date: Date;
  verified: boolean;
}
interface IUserMethods { // no methods now, interface for future

}
interface UserModel extends Model<IUser, {}, IUserMethods> {
    emailTaken(email: string): Promise<HydratedDocument<IUser, IUserMethods>>;
}

Then created the schema, using all interfaces

const userSchema = new Schema<IUser, UserModel, IUserMethods>({...});

Then I'm trying to use pre-save hook to hash password, and I get this error:

Argument of type '"save"' is not assignable to parameter of type 'RegExp | "insertMany"'

userSchema.pre('save', async function (next: NextFunction) {
    const user = this;

    if (user.isModified('password')) {
      const salt = await bcrypt.genSalt(10);
      const hash = await bcrypt.hash(user.password, salt);
    }

    next();
  });

I've tried and .pre<IUser> and .pre<HydratedDocument<IUser>> and .pre<HydratedDocument<IUser, IUserMethods>>, but none has worked.


问:
Questions about setting default property by modifying neo4j source code
I want to modify the source code to add a default property for every node when it's created for study purpose. By reading source code I find the transaction class (in package org.neo4j.graphdb) where all database operations must be performed in, then by following it's CreateNode function I find the NodeEntity class finally(in package org.neo4j.kernel.impl.core).
Can I set the default property for nodes to-be-constructed by modifying NodeEntity class?

what I did:
I followed "Transaction" functions and found the "NodeEntity" class in package "org.neo4j.kernel.impl.core". It seems to be the place there nodes are created, so I by add a new instruction in it's constructor to set the default property:

```<code>public NodeEntity(InternalTransaction internalTransaction, long nodeId) {
        this.internalTransaction = internalTransaction;
        this.nodeId = nodeId;
        String propertyKey = "key";
        String propertyValue = "value";
        this.setProperty(propertyKey, propertyValue);
    }
</code>```

Then I compiled the source code and run it by cypher-shell. But the nodes created don't have the default property "key" and "value".

(I'm compiling neo4j-5.1, running with JDK1.7 and maven 3.8.6, on Windows 10. I use cypher shell on command line to access neo4j)

```<code>neo4j@neo4j> :begin
neo4j@neo4j# create (:person {name:"wenfei"});
0 rows
ready to start consuming query after 1 ms, results consumed after another 0 ms
Added 1 nodes, Set 1 properties, Added 1 labels
neo4j@neo4j# match (m) return m;
+----------------------------+
| m                          |
+----------------------------+
| (:person {name: "wenfei"}) |
+----------------------------+

1 row
ready to start consuming query after 1 ms, results consumed after another 1 ms
</code>```

Which file should be modified instead? I really get stuck, org.neo4j.kernel.impl.core.NodeEntity it the only place I found...

Body:
I want to modify the source code to add a default property for every node when it's created for study purpose. By reading source code I find the transaction class (in package org.neo4j.graphdb) where all database operations must be performed in, then by following it's CreateNode function I find the NodeEntity class finally(in package org.neo4j.kernel.impl.core).
Can I set the default property for nodes to-be-constructed by modifying NodeEntity class?

what I did:
I followed "Transaction" functions and found the "NodeEntity" class in package "org.neo4j.kernel.impl.core". It seems to be the place there nodes are created, so I by add a new instruction in it's constructor to set the default property:

public NodeEntity(InternalTransaction internalTransaction, long nodeId) {
        this.internalTransaction = internalTransaction;
        this.nodeId = nodeId;
        String propertyKey = "key";
        String propertyValue = "value";
        this.setProperty(propertyKey, propertyValue);
    }

Then I compiled the source code and run it by cypher-shell. But the nodes created don't have the default property "key" and "value".

(I'm compiling neo4j-5.1, running with JDK1.7 and maven 3.8.6, on Windows 10. I use cypher shell on command line to access neo4j)

neo4j@neo4j> :begin
neo4j@neo4j# create (:person {name:"wenfei"});
0 rows
ready to start consuming query after 1 ms, results consumed after another 0 ms
Added 1 nodes, Set 1 properties, Added 1 labels
neo4j@neo4j# match (m) return m;
+----------------------------+
| m                          |
+----------------------------+
| (:person {name: "wenfei"}) |
+----------------------------+

1 row
ready to start consuming query after 1 ms, results consumed after another 1 ms

Which file should be modified instead? I really get stuck, org.neo4j.kernel.impl.core.NodeEntity it the only place I found...


问:
There is something wrong, the problem is in the transition. There is a problem when a layout will be visible, invisible
There is something wrong with this place. It means it works properly. But the problem is in the transition. There is a problem when a layout will be visible, invisible .

```<code>if (edittext1.getText().toString().equals("")) {
    textview3.setTextColor(0xFFFF1744);
    final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(linear3,
                                                                           "backgroundColor",
                                                                           new ArgbEvaluator(),
                                                                           0xffEEEEEE,
                                                                           0xffFF1744);
    backgroundColorAnimator.setDuration(500);
    backgroundColorAnimator.start();
}
else {
    if (textview6.getText().toString().equals("Get password reset link")) {
        _telegramLoaderDialog(true);
        firebaseAuth.sendPasswordResetEmail(edittext1.getText().toString()).addOnCompleteListener(_firebaseAuth_reset_password_listener);
    }
    else {
        if (edittext2.getText().toString().equals("")) {
            textview4.setTextColor(0xFFFF1744);
            final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(linear4,
                                                                                "backgroundColor",
                                                                                new ArgbEvaluator(),
                                                                                0xffEEEEEE,
                                                                                0xffFF1744);
            backgroundColorAnimator.setDuration(500);
            backgroundColorAnimator.start();
        }
        else {
            if (Current) {
                if (edittext3.getText().toString().equals("")) {
                    textview9.setTextColor(0xFFFF1744);
                    final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(linear7,
                                                                                "backgroundColor",
                                                                                new ArgbEvaluator(),
                                                                                0xffEEEEEE,
                                                                                0xffFF1744);
                    backgroundColorAnimator.setDuration(500);
                    backgroundColorAnimator.start();
                }
                else {
                    _autoTransitionScroll(vscroll1);
                    linear8.setVisibility(View.VISIBLE);
                    textview6.setVisibility(View.GONE);
                    textview7.setEnabled(false);
                    checkbox1.setEnabled(false);
                    edittext1.setEnabled(false);
                    edittext2.setEnabled(false);
                    edittext3.setEnabled(false);
                    if (edittext2.getText().toString().equals(edittext3.getText().toString())) {
                        if (checkbox1.isChecked()) {
                            firebaseAuth.createUserWithEmailAndPassword(edittext1.getText().toString(), edittext2.getText().toString()).addOnCompleteListener(AuthActivity.this, _firebaseAuth_create_user_listener);
                        }
                        else {
                            _autoTransitionScroll(vscroll1);
                            linear8.setVisibility(View.GONE);
                            textview6.setVisibility(View.VISIBLE);
                            textview7.setEnabled(true);
                            checkbox1.setEnabled(true);
                            edittext1.setEnabled(true);
                            edittext2.setEnabled(true);
                            edittext3.setEnabled(true);
                            LayoutInflater Inflater = getLayoutInflater();

                            View InfView = getLayoutInflater().inflate(R.layout.success_toast, null);

                            LinearLayout border = (LinearLayout) InfView.findViewById(R.id.border);

                            LinearLayout linear3 = (LinearLayout) InfView.findViewById(R.id.linear3);

                            LinearLayout line = (LinearLayout) InfView.findViewById (R.id.line);

                            TextView title = (TextView) InfView.findViewById(R.id.title);

                            TextView content = (TextView) InfView.findViewById(R.id.content);

                            ImageView image_logo = (ImageView) InfView.findViewById(R.id.image_logo);

                            Toast ToastName = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);

                            ToastName.setView(InfView);

                            ToastName.show();
                            image_logo.setImageResource(R.drawable.info1);
                            title.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_med.ttf"), 1);
                            content.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_light.ttf"), 0);
                            _RoundAndBorder(border, "#2F87EB", 0, "#ffffff", 8);
                            _SX_CornerRadius_4(line, "#80ffffff", "#80ffffff", 0, 0, 8, 0, 8);
                            title.setText("Attention Please!");
                            content.setText("Agree with our Privacy Policy and T&Cs to continue creating an account.");
                        }
                    }
                    else {
                        _autoTransitionScroll(vscroll1);
                        linear8.setVisibility(View.GONE);
                        textview6.setVisibility(View.VISIBLE);
                        textview7.setEnabled(true);
                        checkbox1.setEnabled(true);
                        edittext1.setEnabled(true);
                        edittext2.setEnabled(true);
                        edittext3.setEnabled(true);
                        LayoutInflater Inflater = getLayoutInflater();

                        View InfView = getLayoutInflater().inflate(R.layout.success_toast, null);

                        LinearLayout border = (LinearLayout) InfView.findViewById(R.id.border);

                        LinearLayout linear3 = (LinearLayout) InfView.findViewById(R.id.linear3);

                        LinearLayout line = (LinearLayout) InfView.findViewById (R.id.line);

                        TextView title = (TextView) InfView.findViewById(R.id.title);

                        TextView content = (TextView) InfView.findViewById(R.id.content);

                        ImageView image_logo = (ImageView) InfView.findViewById(R.id.image_logo);

                        Toast ToastName = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);

                        ToastName.setView(InfView);

                        ToastName.show();
                        image_logo.setImageResource(R.drawable.info1);
                        title.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_med.ttf"), 1);
                        content.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_light.ttf"), 0);
                        _RoundAndBorder(border, "#2F87EB", 0, "#ffffff", 8);
                        _SX_CornerRadius_4(line, "#80ffffff", "#80ffffff", 0, 0, 8, 0, 8);
                        title.setText("Attention Please!");
                        content.setText("The Passwords you've entered does not match! Please check and try again.");
                    }
                }
            }
            else {
                firebaseAuth.signInWithEmailAndPassword(edittext1.getText().toString(), edittext2.getText().toString()).addOnCompleteListener(AuthActivity.this, _firebaseAuth_sign_in_listener);
                _autoTransitionScroll(vscroll1);
                linear8.setVisibility(View.VISIBLE);
                textview6.setVisibility(View.GONE);
                textview7.setEnabled(false);
                checkbox1.setEnabled(false);
                edittext1.setEnabled(false);
                edittext2.setEnabled(false);
                edittext3.setEnabled(false);
            }
        }
    }
}
</code>```

The animation problem in line if anyone figure out please help me. I try it several times but the animator loding screen not working properly.

Body:
There is something wrong with this place. It means it works properly. But the problem is in the transition. There is a problem when a layout will be visible, invisible .

if (edittext1.getText().toString().equals("")) {
    textview3.setTextColor(0xFFFF1744);
    final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(linear3,
                                                                           "backgroundColor",
                                                                           new ArgbEvaluator(),
                                                                           0xffEEEEEE,
                                                                           0xffFF1744);
    backgroundColorAnimator.setDuration(500);
    backgroundColorAnimator.start();
}
else {
    if (textview6.getText().toString().equals("Get password reset link")) {
        _telegramLoaderDialog(true);
        firebaseAuth.sendPasswordResetEmail(edittext1.getText().toString()).addOnCompleteListener(_firebaseAuth_reset_password_listener);
    }
    else {
        if (edittext2.getText().toString().equals("")) {
            textview4.setTextColor(0xFFFF1744);
            final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(linear4,
                                                                                "backgroundColor",
                                                                                new ArgbEvaluator(),
                                                                                0xffEEEEEE,
                                                                                0xffFF1744);
            backgroundColorAnimator.setDuration(500);
            backgroundColorAnimator.start();
        }
        else {
            if (Current) {
                if (edittext3.getText().toString().equals("")) {
                    textview9.setTextColor(0xFFFF1744);
                    final ObjectAnimator backgroundColorAnimator = ObjectAnimator.ofObject(linear7,
                                                                                "backgroundColor",
                                                                                new ArgbEvaluator(),
                                                                                0xffEEEEEE,
                                                                                0xffFF1744);
                    backgroundColorAnimator.setDuration(500);
                    backgroundColorAnimator.start();
                }
                else {
                    _autoTransitionScroll(vscroll1);
                    linear8.setVisibility(View.VISIBLE);
                    textview6.setVisibility(View.GONE);
                    textview7.setEnabled(false);
                    checkbox1.setEnabled(false);
                    edittext1.setEnabled(false);
                    edittext2.setEnabled(false);
                    edittext3.setEnabled(false);
                    if (edittext2.getText().toString().equals(edittext3.getText().toString())) {
                        if (checkbox1.isChecked()) {
                            firebaseAuth.createUserWithEmailAndPassword(edittext1.getText().toString(), edittext2.getText().toString()).addOnCompleteListener(AuthActivity.this, _firebaseAuth_create_user_listener);
                        }
                        else {
                            _autoTransitionScroll(vscroll1);
                            linear8.setVisibility(View.GONE);
                            textview6.setVisibility(View.VISIBLE);
                            textview7.setEnabled(true);
                            checkbox1.setEnabled(true);
                            edittext1.setEnabled(true);
                            edittext2.setEnabled(true);
                            edittext3.setEnabled(true);
                            LayoutInflater Inflater = getLayoutInflater();

                            View InfView = getLayoutInflater().inflate(R.layout.success_toast, null);

                            LinearLayout border = (LinearLayout) InfView.findViewById(R.id.border);

                            LinearLayout linear3 = (LinearLayout) InfView.findViewById(R.id.linear3);

                            LinearLayout line = (LinearLayout) InfView.findViewById (R.id.line);

                            TextView title = (TextView) InfView.findViewById(R.id.title);

                            TextView content = (TextView) InfView.findViewById(R.id.content);

                            ImageView image_logo = (ImageView) InfView.findViewById(R.id.image_logo);

                            Toast ToastName = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);

                            ToastName.setView(InfView);

                            ToastName.show();
                            image_logo.setImageResource(R.drawable.info1);
                            title.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_med.ttf"), 1);
                            content.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_light.ttf"), 0);
                            _RoundAndBorder(border, "#2F87EB", 0, "#ffffff", 8);
                            _SX_CornerRadius_4(line, "#80ffffff", "#80ffffff", 0, 0, 8, 0, 8);
                            title.setText("Attention Please!");
                            content.setText("Agree with our Privacy Policy and T&Cs to continue creating an account.");
                        }
                    }
                    else {
                        _autoTransitionScroll(vscroll1);
                        linear8.setVisibility(View.GONE);
                        textview6.setVisibility(View.VISIBLE);
                        textview7.setEnabled(true);
                        checkbox1.setEnabled(true);
                        edittext1.setEnabled(true);
                        edittext2.setEnabled(true);
                        edittext3.setEnabled(true);
                        LayoutInflater Inflater = getLayoutInflater();

                        View InfView = getLayoutInflater().inflate(R.layout.success_toast, null);

                        LinearLayout border = (LinearLayout) InfView.findViewById(R.id.border);

                        LinearLayout linear3 = (LinearLayout) InfView.findViewById(R.id.linear3);

                        LinearLayout line = (LinearLayout) InfView.findViewById (R.id.line);

                        TextView title = (TextView) InfView.findViewById(R.id.title);

                        TextView content = (TextView) InfView.findViewById(R.id.content);

                        ImageView image_logo = (ImageView) InfView.findViewById(R.id.image_logo);

                        Toast ToastName = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);

                        ToastName.setView(InfView);

                        ToastName.show();
                        image_logo.setImageResource(R.drawable.info1);
                        title.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_med.ttf"), 1);
                        content.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/en_light.ttf"), 0);
                        _RoundAndBorder(border, "#2F87EB", 0, "#ffffff", 8);
                        _SX_CornerRadius_4(line, "#80ffffff", "#80ffffff", 0, 0, 8, 0, 8);
                        title.setText("Attention Please!");
                        content.setText("The Passwords you've entered does not match! Please check and try again.");
                    }
                }
            }
            else {
                firebaseAuth.signInWithEmailAndPassword(edittext1.getText().toString(), edittext2.getText().toString()).addOnCompleteListener(AuthActivity.this, _firebaseAuth_sign_in_listener);
                _autoTransitionScroll(vscroll1);
                linear8.setVisibility(View.VISIBLE);
                textview6.setVisibility(View.GONE);
                textview7.setEnabled(false);
                checkbox1.setEnabled(false);
                edittext1.setEnabled(false);
                edittext2.setEnabled(false);
                edittext3.setEnabled(false);
            }
        }
    }
}

The animation problem in line if anyone figure out please help me. I try it several times but the animator loding screen not working properly.


问:
Data from MongoDB is in Next.js API; Cannot display it to page with getServerSideProps
I've successfully connected to my mongoDB atlas with Next.js and read into my database and collection. The data is clearly visible in my api directory: https://quotes.stcollier.repl.co/api/quotes

However, the issue occurs when I try to display the data from the database to my /home page.

This is how I do it:

import clientPromise from "../lib/mongodb";
import { AiOutlineLike, AiFillLike, AiOutlineDislike, AiFillDislike } from 'react-icons/ai';

export default function Home(props) {

  return (

      {props.quotes.map((quote) => (

{quote.content}

          ~{quote.author}

            <AiOutlineLike/> {quote.likes}
            <AiOutlineDislike/> {quote.dislikes}

      ))}

  )
}

export async function getServerSideProps({ req, res }) {

  try {
    const client = await clientPromise;
    const db = client.db("all_quotes");

    const quotes = await db
      .collection("quotes")
      .find({})
      .toArray();

    return {
      props: { quotes: JSON.parse(JSON.stringify(quotes)) },
    };

  } catch (e) {
    console.error(e);
  }
}
```
<p>However, this is the error that I'm getting, and I have not been able to solve it for the life of me.</p>
<blockquote>
<p>TypeError: Cannot read properties of undefined (reading 'map')</p>
</blockquote>
<p><img src="https://i.stack.imgur.com/5Bnfu.png" alt="enter image description here" /></p>
<p>I don't understand why this is happening, as the data is clearly able to be fetched from the <code>/api/quotes</code> directory:</p>
<pre class="lang-js prettyprint-override"><code>import clientPromise from "../../lib/mongodb";

export default async (req, res) => {
  try {
    const client = await clientPromise;
    const db = client.db("all_quotes");

    const quotes = await db
      .collection("quotes")
      .find({})
      .toArray();

    res.json(quotes);
  } catch (e) {
    console.error(e);
  }
}
</code>```

My code is virtually the same to the api/quotes directory, so why is the prop that I'm passing with the data undefined? It's all very unclear to me. What am I doing wrong?

You can view the full code here, if that's helpful: https://replit.com/@STCollier/quotes?v=1

Body:
I've successfully connected to my mongoDB atlas with Next.js and read into my database and collection. The data is clearly visible in my api directory: https://quotes.stcollier.repl.co/api/quotes

However, the issue occurs when I try to display the data from the database to my /home page.

This is how I do it:

import clientPromise from "../lib/mongodb";
import { AiOutlineLike, AiFillLike, AiOutlineDislike, AiFillDislike } from 'react-icons/ai';

export default function Home(props) {

  return (

      {props.quotes.map((quote) => (

{quote.content}

          ~{quote.author}

            <AiOutlineLike/> {quote.likes}
            <AiOutlineDislike/> {quote.dislikes}

      ))}

  )
}

export async function getServerSideProps({ req, res }) {

  try {
    const client = await clientPromise;
    const db = client.db("all_quotes");

    const quotes = await db
      .collection("quotes")
      .find({})
      .toArray();

    return {
      props: { quotes: JSON.parse(JSON.stringify(quotes)) },
    };

  } catch (e) {
    console.error(e);
  }
}

However, this is the error that I'm getting, and I have not been able to solve it for the life of me.

TypeError: Cannot read properties of undefined (reading 'map')

I don't understand why this is happening, as the data is clearly able to be fetched from the /api/quotes directory:

import clientPromise from "../../lib/mongodb";

export default async (req, res) => {
  try {
    const client = await clientPromise;
    const db = client.db("all_quotes");

    const quotes = await db
      .collection("quotes")
      .find({})
      .toArray();

    res.json(quotes);
  } catch (e) {
    console.error(e);
  }
}

My code is virtually the same to the api/quotes directory, so why is the prop that I'm passing with the data undefined? It's all very unclear to me. What am I doing wrong?

You can view the full code here, if that's helpful: https://replit.com/@STCollier/quotes?v=1


问:
How to Filter complex array in react native?
I have array

```<code>[{

        "2022-12-06": [{
                "studentname": "xyz",
                "obtainmarks": "120"
            }
        ]
    },
    {

        "2022-12-07": [{
                "studentname": "xyz",
                "obtainmarks": "120"
            },
            {
                "studentname": "xyz2",
                "obtainmarks": "120"
            }
        ]
    }
]
</code>```

I want following result

date-2022-12-06(total marks obtain by students is-120)

studentname-xyz

date-2022-12-07(total marks obtain by students is-240)

studentname-xyz

studentname-xyz2

Body:
I have array

[{

        "2022-12-06": [{
                "studentname": "xyz",
                "obtainmarks": "120"
            }
        ]
    },
    {

        "2022-12-07": [{
                "studentname": "xyz",
                "obtainmarks": "120"
            },
            {
                "studentname": "xyz2",
                "obtainmarks": "120"
            }
        ]
    }
]

I want following result

date-2022-12-06(total marks obtain by students is-120)

studentname-xyz

date-2022-12-07(total marks obtain by students is-240)

studentname-xyz

studentname-xyz2


问:
How to access asp.net SOAP web service post call at same time with different endpoints in two different web parts?
How to access asp.net SOAP web service post call at same time with different endpoints in two different web parts?

Currently when I am trying access SOAP web services post call at same time with different endpoints then one call is success and another call is throwing error.

I have tried both the SOAP web service post call from different web parts in same page.


问:
Joining potentially blank fields in a Power Automate expression without `compact`?
A pretty typical operation is to combine first, middle, and last names into a display name often with last naming coming first, a comma and then the rest such as "Doe, John".

I mean look at this abomination.  It works, but it only joins first and last.  If middle was present it would be even uglier.

join(
  if(empty(outputs('Get_a_row_by_ID')?['body/new_lastname']),
    if(empty(outputs('Get_a_row_by_ID')?['body/new_firstname']),
      createArray(),
      createArray(outputs('Get_a_row_by_ID')?['body/new_firstname'])),
    if(empty(outputs('Get_a_row_by_ID')?['body/new_firstname']),
      createArray(outputs('Get_a_row_by_ID')?['body/new_lastname']),
      createArray(outputs('Get_a_row_by_ID')?['body/new_lastname'], outputs('Get_a_row_by_ID')?['body/new_firstname']))),
  ', ')

```

I mean join is, I think, what you want, but the repetition is, unfortunately, necessary.

Is there another form one could use to avoid all the repetition?  If a compact function were available it would eliminate the redundancy completely, and coalesce is useful outside an array, but not helpful here.

Obviously, this attempts to handle nulls in any field so we get "Doe" or "John" without a comma.

Body:
A pretty typical operation is to combine first, middle, and last names into a display name often with last naming coming first, a comma and then the rest such as "Doe, John".

I mean look at this abomination.  It works, but it only joins first and last.  If middle was present it would be even uglier.

join(
  if(empty(outputs('Get_a_row_by_ID')?['body/new_lastname']),
    if(empty(outputs('Get_a_row_by_ID')?['body/new_firstname']),
      createArray(),
      createArray(outputs('Get_a_row_by_ID')?['body/new_firstname'])),
    if(empty(outputs('Get_a_row_by_ID')?['body/new_firstname']),
      createArray(outputs('Get_a_row_by_ID')?['body/new_lastname']),
      createArray(outputs('Get_a_row_by_ID')?['body/new_lastname'], outputs('Get_a_row_by_ID')?['body/new_firstname']))),
  ', ')

I mean join is, I think, what you want, but the repetition is, unfortunately, necessary.

Is there another form one could use to avoid all the repetition?  If a compact function were available it would eliminate the redundancy completely, and coalesce is useful outside an array, but not helpful here.

Obviously, this attempts to handle nulls in any field so we get "Doe" or "John" without a comma.


问:
vue3 vuex instance in router not available
I would like to call up a page via router with several parameters.

with the beforeeach method of the router I would like e.g. store these parameters in the store. unfortunately this doesn't work.

in main.js I initialize store and router

```<code>import store from "./store/global-store";
import router from "./router/router";
</code>```

the essence of the store

```<code>import { createStore } from 'vuex'

const store = createStore({
  state() {
    return {
      debug: true,
      roomId: 0,
      roomPageId: 1
    }
 }
})
</code>```

this is how it looks in my router.

```<code>let store = useStore()

router.beforeEach((to, from) => {

  console.log("to", to.params )
  if(!Object.prototype.hasOwnProperty.call(to.params, "pageId") ) {
    to.params.pageId = 1;
  } else {
    // console.log(store)
    store.state.roomPageId = to.params.pageId;
  }
})
</code>```

unfortunately the store is not available in the router, why? The store is present in all other components, where is the problem that it does not work in the router.is the store not ready yet?

Body:
I would like to call up a page via router with several parameters.

with the beforeeach method of the router I would like e.g. store these parameters in the store. unfortunately this doesn't work.

in main.js I initialize store and router

import store from "./store/global-store";
import router from "./router/router";

the essence of the store

import { createStore } from 'vuex'

const store = createStore({
  state() {
    return {
      debug: true,
      roomId: 0,
      roomPageId: 1
    }
 }
})

this is how it looks in my router.

let store = useStore()

router.beforeEach((to, from) => {

  console.log("to", to.params )
  if(!Object.prototype.hasOwnProperty.call(to.params, "pageId") ) {
    to.params.pageId = 1;
  } else {
    // console.log(store)
    store.state.roomPageId = to.params.pageId;
  }
})

unfortunately the store is not available in the router, why? The store is present in all other components, where is the problem that it does not work in the router.is the store not ready yet?


问:
How to check if or not my (custom) ROM has 'classes.dex' in 'services.jar'?
I have a degoogled device (cactus) having a cr - lineage os 17.1 (unofficial) - and in order to use micro-g I have to first patch my device first, and to do that I first have to manually deodex 'services.jar' as preparation for signature spoofing support but only when 'services.jar' do not contain 'classes.dex' file. I cannot figure out that how to check if it's 'classes.dex' or not.
How can I find that?

I tried looking for it in recovery mode (I use twrp) but my attempt was in vain.


问:
How can i do this animation from framer motion?
I'm trying to recreate this website (https://www.framer.com/motion/) I did most of them, but I can't seem to understand this "watch" animation that I pointed in the picture at the beginning of the page. I would be grateful for any help I can get. Thanks in advance.

(https://i.stack.imgur.com/q4ZGK.png)


问:
Avoid Repeated Includes
I am new to entity framework. I have an entity A which has many-to-many relationship with other entities.
In the repository used to get an entity A, I use the following code:

```<code>_dbContext.Set<A>.Where(a => a.Id == id).Include(a => a.B).ThenInclude(b=>b.C).Include(a=>a.D)
.SingleOrDefaultAsync();
</code>```

In entite's X repo, I use the following:

```<code>_dbContext.Set<X>.Where(x => x.Id == id).Include(x=>x.As).ThenInclude(a => a.B).ThenInclude(b=>b.C)
.Include(x=>x.As).Include(a=>a.D).SingleOrDefaultAsync();
</code>```

So if for entities Y and Z, I have to write the same includes/thenIncludes.

Is there a way to have these includes in just one place and use them in the different repos?

Title: Avoid Repeated Includes

Body:
I am new to entity framework. I have an entity A which has many-to-many relationship with other entities.
In the repository used to get an entity A, I use the following code:

_dbContext.Set.Where(a => a.Id == id).Include(a => a.B).ThenInclude(b=>b.C).Include(a=>a.D)
.SingleOrDefaultAsync();

In entite's X repo, I use the following:

_dbContext.Set<X>.Where(x => x.Id == id).Include(x=>x.As).ThenInclude(a => a.B).ThenInclude(b=>b.C)
.Include(x=>x.As).Include(a=>a.D).SingleOrDefaultAsync();

So if for entities Y and Z, I have to write the same includes/thenIncludes.

Is there a way to have these includes in just one place and use them in the different repos?


问:
Connection pool keeps closing in Neptune
I am having a problem to execute gremlin queries on a lambda function that intends to ingest into Amazon Neptune.

Time and time again I receive these logs:

enter image description here

I followed the specifications that Amazon itself has in this page https://docs.aws.amazon.com/neptune/latest/userguide/lambda-functions-examples.html

all the code is the same.


问:
Autofac.Core.DependencyResolutionException : An exception was thrown while activating CommunDataManager
I'm new at unit testing, I'm trying to test the data manager this is the class to test:

```<code> public sealed class CommunDataManager : IDisposable
    {
        private readonly ISharedLogService _log;
        private readonly ISensitiveData _iSensitiveData;
        private readonly BadisRepository _badisRepository;
        public CommunDataManager()
        {
            _log = ModuleSharedServices.Instance.GetService<ISharedLogService>();
            _iSensitiveData = ModuleSharedServices.Instance.GetService<ISensitiveData>();
            _badisRepository = new BadisRepository(_iSensitiveData.DbPath, _iSensitiveData.DbKey);
        }
        private static CommunDataManager _instance;

        public static CommunDataManager GetInstance()
        {
            if (_instance == null)
            {
                _instance = new CommunDataManager();
            }
            return _instance;
        }

       public List<Article_Famille> GetArticleFamilleByCriteria(string libelle)
        {
            _log.Write("GetArticleFamilleByCriteria : recherche famille par critère",            System.Diagnostics.TraceEventType.Information);
            var predicate = QueryableBuilderExtensions.BuildPredicate<Article_Famille>(_ => _
                          .Contains(x => x.Libelle, libelle));
            return _badisRepository.GetRepository<Article_Famille>().GetMuliple(predicate);
        }
</code>```

and this is the test method:

```<code>[Test]
        public void test1()
        {
            using (var mock = AutoMock.GetLoose())
            {
                var cls = mock.Create<CommunDataManager>();
                var expected = cls.GetArticleFamilleByCriteria("Pharmacie");
                var actual = cls.Equals(expected);
                Assert.True(actual != null);
            }

        }
</code>```

But after executing the test I got this Error:

Autofac.Core.DependencyResolutionException : An exception was thrown while activating CommunDataManager.

Body:
I'm new at unit testing, I'm trying to test the data manager this is the class to test:

 public sealed class CommunDataManager : IDisposable
    {
        private readonly ISharedLogService _log;
        private readonly ISensitiveData _iSensitiveData;
        private readonly BadisRepository _badisRepository;
        public CommunDataManager()
        {
            _log = ModuleSharedServices.Instance.GetService<ISharedLogService>();
            _iSensitiveData = ModuleSharedServices.Instance.GetService<ISensitiveData>();
            _badisRepository = new BadisRepository(_iSensitiveData.DbPath, _iSensitiveData.DbKey);
        }
        private static CommunDataManager _instance;

        public static CommunDataManager GetInstance()
        {
            if (_instance == null)
            {
                _instance = new CommunDataManager();
            }
            return _instance;
        }

       public List<Article_Famille> GetArticleFamilleByCriteria(string libelle)
        {
            _log.Write("GetArticleFamilleByCriteria : recherche famille par critère",            System.Diagnostics.TraceEventType.Information);
            var predicate = QueryableBuilderExtensions.BuildPredicate<Article_Famille>(_ => _
                          .Contains(x => x.Libelle, libelle));
            return _badisRepository.GetRepository<Article_Famille>().GetMuliple(predicate);
        }

and this is the test method:

[Test]
        public void test1()
        {
            using (var mock = AutoMock.GetLoose())
            {
                var cls = mock.Create<CommunDataManager>();
                var expected = cls.GetArticleFamilleByCriteria("Pharmacie");
                var actual = cls.Equals(expected);
                Assert.True(actual != null);
            }

        }

But after executing the test I got this Error:

Autofac.Core.DependencyResolutionException : An exception was thrown while activating CommunDataManager.


问:
Any help, on why is returning the same status in every object here?
So I have a search endpoint here which will fetch the users that contains certain entry and check if there is any on going friends relationship.

My endpoint:

```<code>    path('filter/', SearchUserByStringAPIView.as_view()),
</code>```

My View:

```<code>class SearchUserByStringAPIView(ListAPIView):

    queryset = User.objects.all()
    serializer_class = UserProfileSerializer
    permission_classes = [IsAuthenticated]

    def get_queryset(self):
        queryset = self.queryset.filter(username__icontains=self.request.query_params.get('search'))
        return queryset
</code>```

My Serializer:

```<code>class UserProfileSerializer(serializers.ModelSerializer):

    friendship = serializers.SerializerMethodField()

    def get_friendship(self, obj):

        user_obj = self.instance.values_list('id')
        friends_obj = Friend.objects.filter(Q(receiver=self.context['request'].user) | Q(requester=self.context['request'].user)).values_list('requester', 'receiver', 'status')
        if not friends_obj:
            pass
        else:
            for f in friends_obj:
                for i in user_obj:
                    if int(i[0]) in f:
                        return str(f[2])
                    pass

    class Meta:

        model = User
        fields = ['id', 'username', 'about_me', 'avatar', 'friendship']

</code>```

My Response :

```<code>[
    {
        "id": 2,
        "username": "BB",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 3,
        "username": "BiG",
        "about_me": "",
        "avatar": "http://127.0.0.1:8000/media-files/BigG/Screen_Shot_2022-11-14_at_22.06.55.png",
        "friendship": "A"
    },
    {
        "id": 7,
        "username": "babybabybear",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 13,
        "username": "shadabjamil",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 14,
        "username": "sirberkut",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 17,
        "username": "buddlehman",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 20,
        "username": "tforbes",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 30,
        "username": "ol99bg",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    }
]
</code>```

Now this are are the user from my search and according to my Friend object only the first 2 users should have a stats 'A' accepted and the rest should not have any status

What am I doing wrong here ?

Body:
So I have a search endpoint here which will fetch the users that contains certain entry and check if there is any on going friends relationship.

My endpoint:

    path('filter/', SearchUserByStringAPIView.as_view()),

My View:

class SearchUserByStringAPIView(ListAPIView):

    queryset = User.objects.all()
    serializer_class = UserProfileSerializer
    permission_classes = [IsAuthenticated]

    def get_queryset(self):
        queryset = self.queryset.filter(username__icontains=self.request.query_params.get('search'))
        return queryset

My Serializer:

class UserProfileSerializer(serializers.ModelSerializer):

    friendship = serializers.SerializerMethodField()

    def get_friendship(self, obj):

        user_obj = self.instance.values_list('id')
        friends_obj = Friend.objects.filter(Q(receiver=self.context['request'].user) | Q(requester=self.context['request'].user)).values_list('requester', 'receiver', 'status')
        if not friends_obj:
            pass
        else:
            for f in friends_obj:
                for i in user_obj:
                    if int(i[0]) in f:
                        return str(f[2])
                    pass

    class Meta:

        model = User
        fields = ['id', 'username', 'about_me', 'avatar', 'friendship']

My Response :

[
    {
        "id": 2,
        "username": "BB",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 3,
        "username": "BiG",
        "about_me": "",
        "avatar": "http://127.0.0.1:8000/media-files/BigG/Screen_Shot_2022-11-14_at_22.06.55.png",
        "friendship": "A"
    },
    {
        "id": 7,
        "username": "babybabybear",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 13,
        "username": "shadabjamil",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 14,
        "username": "sirberkut",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 17,
        "username": "buddlehman",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 20,
        "username": "tforbes",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    },
    {
        "id": 30,
        "username": "ol99bg",
        "about_me": "",
        "avatar": null,
        "friendship": "A"
    }
]

Now this are are the user from my search and according to my Friend object only the first 2 users should have a stats 'A' accepted and the rest should not have any status

What am I doing wrong here ?


问:
how to load image from url and insert into rich text box using chrome extension
I'm building a chrome extension that loads an image from a URL (as png/jpeg) and then inserts it into a page's rich text field, for ex: Gmail, Slack, etc. To further refine the problem: if you have an image URL, how'd you paste the image into the rich text editor? What is the best way to implement it?

Current answers when I looked include pasting an image from the user's clipboard, but I don't want to mess up with the user's clipboard as it'll lead to overwriting the existing item in it.

Update: so there's this deprecated execCommand API that can be used to insert images. Is that the best solution available?

document.execCommand("insertimage",false,"https://via.placeholder.com/150")
```


问:
Calculate similarity between sets of keywords in Python
For my project I want to compare to sets of keywords that are stored in lists and obtain a similarity index.

An example would look like the following:

db_1: list of 5 keywords
db_2: list of 10 keywords

The data was obtained mostly through web scraping and keyword engineering with rake_nltk therefore they don't exactly match. Semantically there are differences despite the keywords have the same meaning.

Is there any way to get a more or less reliable similarity index, to determine how similar the entries of db_1 and db_2 are?

Please find an example here:

I tried to calculate similarity using the spacy library, nevertheless I can't import the module because my environment is not compatible with all versions I tried to install.

Do you know any alternatives?


问:
Cannot access a disposed object (LoggerFactory)
We are using .NET 6, Hangfire.AspNetCore 1.7.31 and Hangfire.InMemory 0.3.4. This is how we configure Hangfire in Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
  // ...

  services.AddHangfire(configuration =>
  {
    configuration.UseInMemoryStorage();
  });

  services.AddHangfireServer(x =>
  {
    x.WorkerCount = 5;
  });

  // ...
}
```
<p>We have a unit test which calls <code>RecurringJob.RemoveIfExists("jobId")</code> somewhere in its body. This test was working for a long time and failed randomly today. We re-ran the test multiple times but we were unable to reproduce the exception.</p>
<p>Error message:</p>
```System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'LoggerFactory'.
```
<p>Stacktrace:</p>
```at Microsoft.Extensions.Logging.LoggerFactory.CreateLogger(String categoryName)
at Hangfire.AspNetCore.AspNetCoreLogProvider.GetLogger(String name)
at Hangfire.Logging.LogProvider.GetLogger(String name)
at Hangfire.Logging.LogProvider.GetLogger(Type type)
at Hangfire.Client.CoreBackgroundJobFactory..ctor(IStateMachine stateMachine)
at Hangfire.Client.BackgroundJobFactory..ctor(IJobFilterProvider filterProvider)
at Hangfire.RecurringJobManager..ctor(JobStorage storage, IJobFilterProvider filterProvider, ITimeZoneResolver timeZoneResolver, Func`1 nowFactory)
at Hangfire.RecurringJobManager..ctor(JobStorage storage, IJobFilterProvider filterProvider, ITimeZoneResolver timeZoneResolver)
at Hangfire.RecurringJobManager..ctor(JobStorage storage, IJobFilterProvider filterProvider)
at Hangfire.RecurringJobManager..ctor(JobStorage storage)
at Hangfire.RecurringJobManager..ctor()
at Hangfire.RecurringJob.<>c.<.cctor>b__21_0()
at System.Lazy`1.PublicationOnlyViaFactory(LazyHelper initializer)
at System.Lazy`1.CreateValue()
at Hangfire.RecurringJob.RemoveIfExists(String recurringJobId)
at OurApplication.Service.BL.Identity.OurServiceBL.DeleteHangfireRecurringJobIfHangfireIsEnabled(String jobId)
```

Why did the exception occur? How can we prevent it from happening again?

Body:
We are using .NET 6, Hangfire.AspNetCore 1.7.31 and Hangfire.InMemory 0.3.4. This is how we configure Hangfire in Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
  // ...

  services.AddHangfire(configuration =>
  {
    configuration.UseInMemoryStorage();
  });

  services.AddHangfireServer(x =>
  {
    x.WorkerCount = 5;
  });

  // ...
}

We have a unit test which calls RecurringJob.RemoveIfExists("jobId") somewhere in its body. This test was working for a long time and failed randomly today. We re-ran the test multiple times but we were unable to reproduce the exception.

Error message:

System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'LoggerFactory'.

Stacktrace:

at Microsoft.Extensions.Logging.LoggerFactory.CreateLogger(String categoryName)
at Hangfire.AspNetCore.AspNetCoreLogProvider.GetLogger(String name)
at Hangfire.Logging.LogProvider.GetLogger(String name)
at Hangfire.Logging.LogProvider.GetLogger(Type type)
at Hangfire.Client.CoreBackgroundJobFactory..ctor(IStateMachine stateMachine)
at Hangfire.Client.BackgroundJobFactory..ctor(IJobFilterProvider filterProvider)
at Hangfire.RecurringJobManager..ctor(JobStorage storage, IJobFilterProvider filterProvider, ITimeZoneResolver timeZoneResolver, Func`1 nowFactory)
at Hangfire.RecurringJobManager..ctor(JobStorage storage, IJobFilterProvider filterProvider, ITimeZoneResolver timeZoneResolver)
at Hangfire.RecurringJobManager..ctor(JobStorage storage, IJobFilterProvider filterProvider)
at Hangfire.RecurringJobManager..ctor(JobStorage storage)
at Hangfire.RecurringJobManager..ctor()
at Hangfire.RecurringJob.<>c.<.cctor>b__21_0()
at System.Lazy`1.PublicationOnlyViaFactory(LazyHelper initializer)
at System.Lazy`1.CreateValue()
at Hangfire.RecurringJob.RemoveIfExists(String recurringJobId)
at OurApplication.Service.BL.Identity.OurServiceBL.DeleteHangfireRecurringJobIfHangfireIsEnabled(String jobId)

Why did the exception occur? How can we prevent it from happening again?


问:
vue3 how to convert shortcodes to dynamic component
I use wordpress as a headless CMS to deliver content in an exhibition to different end devices. It goes from the multi-user 4K display to the mobile phone of the visitor.

In order to be able to offer different UX on the devices, I would like to work with shortcodes that are then interpreted accordingly in the frontend. Ideally, the shortcode is implemented as a component.

I'm looking for instructions, a few sample scripts, would hate to develop it from scratch.

the loaded code could look like this:

```<code>html code

[[[ VIDEO FILEBASENAME ]]]

html code

[[[ MAP FILEBASENAME ]]]
</code>```

Body:
I use wordpress as a headless CMS to deliver content in an exhibition to different end devices. It goes from the multi-user 4K display to the mobile phone of the visitor.

In order to be able to offer different UX on the devices, I would like to work with shortcodes that are then interpreted accordingly in the frontend. Ideally, the shortcode is implemented as a component.

I'm looking for instructions, a few sample scripts, would hate to develop it from scratch.

the loaded code could look like this:

html code

[[[ VIDEO FILEBASENAME ]]]

html code

[[[ MAP FILEBASENAME ]]]


问:
Should HTTP status codes be based on physicality or virtuality?
I have a backend which allows users to issue badges to each other. There are 2 endpoints:

Issue Badge

Accept Badge

After issuing some other user a badge, it should also be accepted by that issued user.

I have read in many different places that POST requests should return 201 status with location header if creation is successful, and 202 if the request is being queued to be executed but not finished. I am having hard time understanding what creation means exactly here. Because there are 2 perspectives you can look at it, considering my issue badge endpoint:

Technically, the issue relation is added to the users, meaning a new relation row is created in database, so it should return 201.

Even though a relation row in database is created, ISSUING event is actually not complete yet, so it should return 202.

So I tried to generalize this question in my mind as follows. Does status codes should be returned based on what is created (or updated, deleted in that manner) in the database, even though what is created is just a relation and not even an object by itself, or based on what happened virtually within that execution?


问:
How to implement email tracking send by email?
I want to implement email tracking send by email by Rails application.
I want to know how many users open my email.

here I am using Localtunnel

<img src=<%="https://fluffy-lemons-tan-223-236-34-196.loca.lt/user/#{@user.id}/track_email "%> class="profile" />

How to call track_email? means when I open email track_email action has not been calling.


问:
How can a Android service search an entire broadcast (intent) message without knowing which methods, bundles, extension, etc are req'd?
I have a requirement where this service can listen for various broadcasts / intents from the Android System. The service would receive these intents and look within the intent for a value/string/enum that would inform the service to do something. Because the requirements might change over time, the service would need to listen for different intents on a daily basis. Is there a way to build the service such that I do not have to know the structure of each intent and simply search through the entire data structure itself?</p>


问:
How to combine values in prometheus
I have such data in prometheus:

```<code>dpss_metric{account_id="100", adoption_level="high", attribute_id="dvr_catchup"}
25615593
dpss_metric{account_id="100", adoption_level="high", attribute_id="ingest_udp_mpegts"}
255593
dpss_metric{account_id="101", adoption_level="low", attribute_id="ingest_udp_mpegts"}
878874
dpss_metric{account_id="101", adoption_level="low", attribute_id="dvr_catchup"}
307001
dpss_metric{account_id="102", adoption_level="low", attribute_id="push_udp_spts"}
13061
dpss_metric{account_id="102", adoption_level="low", attribute_id="dvr_catchup"}
1061
dpss_metric{account_id="102", adoption_level="low", attribute_id="ingest_udp_mpegts"}
164461
dpss_metric{account_id="103", adoption_level="low", attribute_id="push_udp_spts"}
130613
dpss_metric{account_id="104", adoption_level="low", attribute_id="push_udp_spts"}
30613
</code>```

I need to group the values so that I can count how many accounts use a certain combination of attributes. For example , account 100 uses dvr_catchup and ingest_udp_mpegts attributes , account 101 uses the same attributes.

And it should turn out something like this

```<code>dpss_metric{attribute_id=["dvr_catchup", "ingest_udp_mpegts"]}     2
dpss_metric{attribute_id=["push_udp_spts", "dvr_catchup", "ingest_udp_mpegts"]}    1
dpss_metric{attribute_id=["push_udp_spts"]}    2
</code>```

Title: How to combine values in prometheus

Body:
I have such data in prometheus:

dpss_metric{account_id="100", adoption_level="high", attribute_id="dvr_catchup"}
25615593
dpss_metric{account_id="100", adoption_level="high", attribute_id="ingest_udp_mpegts"}
255593
dpss_metric{account_id="101", adoption_level="low", attribute_id="ingest_udp_mpegts"}
878874
dpss_metric{account_id="101", adoption_level="low", attribute_id="dvr_catchup"}
307001
dpss_metric{account_id="102", adoption_level="low", attribute_id="push_udp_spts"}
13061
dpss_metric{account_id="102", adoption_level="low", attribute_id="dvr_catchup"}
1061
dpss_metric{account_id="102", adoption_level="low", attribute_id="ingest_udp_mpegts"}
164461
dpss_metric{account_id="103", adoption_level="low", attribute_id="push_udp_spts"}
130613
dpss_metric{account_id="104", adoption_level="low", attribute_id="push_udp_spts"}
30613

I need to group the values so that I can count how many accounts use a certain combination of attributes. For example , account 100 uses dvr_catchup and ingest_udp_mpegts attributes , account 101 uses the same attributes.

And it should turn out something like this

dpss_metric{attribute_id=["dvr_catchup", "ingest_udp_mpegts"]}     2
dpss_metric{attribute_id=["push_udp_spts", "dvr_catchup", "ingest_udp_mpegts"]}    1
dpss_metric{attribute_id=["push_udp_spts"]}    2


问:
How to calculate total working Hours in of a staff django
I want to calculate the total working hours of a staff

the date range is custom .the date

current response

```<code> {
        "user": {
          "username": "admin22",
          "email": "admin22@gmail.com",
          "is_active": true
        },
        "logged_in": "2022-12-07T09:32:15.995835",
        "logged_out": "2022-12-07T10:08:23.071621",
        "date": "2022-12-07"
      },
      {
        "user": {
          "username": "admin22",
          "email": "admin22@gmail.com",
          "is_active": true
        },
        "logged_in": "2022-12-07T10:08:45.994323",
        "logged_out": "",
        "date": "2022-12-07"
      }
    ]
  },
</code>```

model

`
class StaffTracking(models.Model):
user            = models.ForeignKey(Users, related_name="users", on_delete=models.CASCADE)
logged_in       = models.DateTimeField(('logged_in'), null=True, blank=True)
logged_out      = models.DateTimeField(('logged_out'), null=True, blank=True)
date            = models.DateField(_('date'), null=True, blank=True)

```<code>
#VIEWS

</code>```

date_from = openapi.Parameter('date_from', openapi.IN_QUERY, type=openapi.TYPE_STRING,description="The job status", required=False)
date_to    = openapi.Parameter('date_to', openapi.IN_QUERY, type=openapi.TYPE_STRING,description="The file name ", required=False)
staff      = openapi.Parameter('staff', openapi.IN_QUERY, type=openapi.TYPE_STRING,description="The client name", required=False)

```<code>@swagger_auto_schema(tags=["Dashboard"], manual_parameters=[date_from, date_to,staff],pagination_class=RestPagination)
def get(self, request):
    try:

        serializer = self.serializer_class(data=request.GET)
        if not serializer.is_valid():
            self.response_format['status_code'] = status.HTTP_400_BAD_REQUEST
            self.response_format["status"] = False
            self.response_format["errors"] = serializer.errors
            return Response(self.response_format, status=status.HTTP_400_BAD_REQUEST)

        date_from  = serializer.validated_data.get('date_from', None)
        date_to   = serializer.validated_data.get('date_to', None)
        staff     = serializer.validated_data.get('staff', None)

        filtering_data = StaffTracking.objects.all()

        if staff is not None and staff:
            filtering_data = filtering_data.filter(user=staff)

        if staff is  None :
            filtering_data = filtering_data.all()

        if date_from is not None:
            filtering_data = filtering_data.filter(logged_in__date=date_from)

        if date_to is not None:
            filtering_data = filtering_data.filter(logged_out__date=date_to)
</code>```
```<code></code>```

Body:
I want to calculate the total working hours of a staff

the date range is custom .the date

current response

 {
        "user": {
          "username": "admin22",
          "email": "admin22@gmail.com",
          "is_active": true
        },
        "logged_in": "2022-12-07T09:32:15.995835",
        "logged_out": "2022-12-07T10:08:23.071621",
        "date": "2022-12-07"
      },
      {
        "user": {
          "username": "admin22",
          "email": "admin22@gmail.com",
          "is_active": true
        },
        "logged_in": "2022-12-07T10:08:45.994323",
        "logged_out": "",
        "date": "2022-12-07"
      }
    ]
  },

model

`
class StaffTracking(models.Model):
user            = models.ForeignKey(Users, related_name="users", on_delete=models.CASCADE)
logged_in       = models.DateTimeField(('logged_in'), null=True, blank=True)
logged_out      = models.DateTimeField(('logged_out'), null=True, blank=True)
date            = models.DateField(_('date'), null=True, blank=True)

#VIEWS

date_from = openapi.Parameter('date_from', openapi.IN_QUERY, type=openapi.TYPE_STRING,description="The job status", required=False)
date_to    = openapi.Parameter('date_to', openapi.IN_QUERY, type=openapi.TYPE_STRING,description="The file name ", required=False)
staff      = openapi.Parameter('staff', openapi.IN_QUERY, type=openapi.TYPE_STRING,description="The client name", required=False)

@swagger_auto_schema(tags=["Dashboard"], manual_parameters=[date_from, date_to,staff],pagination_class=RestPagination)
def get(self, request):
    try:

        serializer = self.serializer_class(data=request.GET)
        if not serializer.is_valid():
            self.response_format['status_code'] = status.HTTP_400_BAD_REQUEST
            self.response_format["status"] = False
            self.response_format["errors"] = serializer.errors
            return Response(self.response_format, status=status.HTTP_400_BAD_REQUEST)

        date_from  = serializer.validated_data.get('date_from', None)
        date_to   = serializer.validated_data.get('date_to', None)
        staff     = serializer.validated_data.get('staff', None)

        filtering_data = StaffTracking.objects.all()

        if staff is not None and staff:
            filtering_data = filtering_data.filter(user=staff)

        if staff is  None :
            filtering_data = filtering_data.all()

        if date_from is not None:
            filtering_data = filtering_data.filter(logged_in__date=date_from)

        if date_to is not None:
            filtering_data = filtering_data.filter(logged_out__date=date_to)


问:
Can .htaccess be used to re-write anchor links on a page?
I have a .php file that outputs html. In the html there are links in the form of anchor tags, eg:

Page 1

Can .htaccess be used to rewrite this as:

Page 1

...so in the .php file the code is written as the first example but when the page is inspected in the browser the served link is as the second example?

Thanks


问:
Pygame RayCasting glitch
it should be a straight wall
I need help
I'm trying to make a doom style game and I have a problem with RayCasting.
I do everything according to the video in the link. But textures are glitching.
I would appreciate any advice

Video with my RayCasting bug : https://www.youtube.com/watch?v=m6Bn9ELJKl0

The video I follow : https://youtu.be/ECqUrT7IdqQ?t=469

My RayCasting code:

```<code>import pygame as pg
import math
from settings import *

class RayCasting:
    def __init__(self, game):
        self.game = game
        self.ray_casting_result = []
        self.objects_to_render = []
        self.textures = self.game.object_renderer.wall_textures

    def get_objects_to_render(self):
        self.objects_to_render = []
        for ray, values in enumerate(self.ray_casting_result):
            depth, proj_height, texture, offset = values

            if proj_height < HEIGHT:
                wall_column = self.textures[texture].subsurface(
                    offset * (TEXTURE_SIZE - SCALE), 0, SCALE, TEXTURE_SIZE
                )
                wall_column = pg.transform.scale(wall_column, (SCALE, proj_height))
                wall_pos = (ray * SCALE, HALF_HEIGHT - proj_height // 2)
            else:
                texture_height = TEXTURE_SIZE * HEIGHT / proj_height
                wall_column = self.textures[texture].subsurface(
                    offset * (TEXTURE_SIZE - SCALE), HALF_TEXTURE_SIZE - texture_height // 2,
                    SCALE,  texture_height
                )
                wall_column = pg.transform.scale(wall_column, (SCALE, HEIGHT))
                wall_pos = (ray * SCALE, 0)

            self.objects_to_render.append((depth, wall_column, wall_pos))

    def ray_cast(self):
        self.ray_casting_result = []
        ox, oy = self.game.player.pos
        x_map, y_map = self.game.player.map_pos

        texture_vert, texture_hor = 1, 1

        ray_angle = self.game.player.angle - HALF_FOV + 0.0001
        for ray in range(NUM_RAYS):
            sin_a = math.sin(ray_angle)
            cos_a = math.cos(ray_angle)

            #horizontals
            y_hor, dy = (y_map + 1, 1) if sin_a > 0 else (y_map - 1e-6, -1)

            depth_hor = (y_hor - oy) / sin_a
            x_hor = ox + depth_hor * cos_a

            delta_depth = dy / sin_a
            dx = delta_depth * cos_a

            for i in range(MAX_DEPTH):
                tile_hor = int(x_hor), int(y_hor)
                if tile_hor in self.game.map.world_map:
                    texture_hor = self.game.map.world_map[tile_hor]
                    break
                x_hor += dx
                y_hor += dy
                depth_hor += delta_depth

            # verticals
            x_vert, dx = (x_map + 1, 1) if cos_a > 0 else (x_map - 1e-6, -1)

            depth_vert = (x_vert - ox) / cos_a
            y_vert = oy + depth_vert + sin_a

            delta_depth = dx / cos_a
            dy = delta_depth * sin_a

            for i in range(MAX_DEPTH):
                tile_vert = int(x_vert), int(y_vert)
                if tile_vert in self.game.map.world_map:
                    texture_vert = self.game.map.world_map[tile_vert]
                    break
                x_vert += dx
                y_vert += dy
                depth_vert += delta_depth

            # depth, texture offset
            if depth_vert < depth_hor:
                depth, texture = depth_vert, texture_vert
                y_vert %= 1
                offset = y_vert if cos_a > 0 else (1 - y_vert)
            else:
                depth, texture = depth_hor, texture_hor
                x_hor %= 1
                offset = (1 - x_hor) if sin_a > 0 else x_hor

            # remove fishbowl effect
            depth *= math.cos(self.game.player.angle - ray_angle)

            # projection
            proj_height = SCREEN_DIST / (depth + 0.0001)

            #ray casting result
            self.ray_casting_result.append((depth, proj_height, texture, offset))

            ray_angle += DELTA_ANGLE

    def update(self):
        self.ray_cast()
        self.get_objects_to_render()
</code>```

Title: Pygame RayCasting glitch

Body:
it should be a straight wall
I need help
I'm trying to make a doom style game and I have a problem with RayCasting.
I do everything according to the video in the link. But textures are glitching.
I would appreciate any advice

Video with my RayCasting bug : https://www.youtube.com/watch?v=m6Bn9ELJKl0

The video I follow : https://youtu.be/ECqUrT7IdqQ?t=469

My RayCasting code:

import pygame as pg
import math
from settings import *

class RayCasting:
    def __init__(self, game):
        self.game = game
        self.ray_casting_result = []
        self.objects_to_render = []
        self.textures = self.game.object_renderer.wall_textures

    def get_objects_to_render(self):
        self.objects_to_render = []
        for ray, values in enumerate(self.ray_casting_result):
            depth, proj_height, texture, offset = values

            if proj_height < HEIGHT:
                wall_column = self.textures[texture].subsurface(
                    offset * (TEXTURE_SIZE - SCALE), 0, SCALE, TEXTURE_SIZE
                )
                wall_column = pg.transform.scale(wall_column, (SCALE, proj_height))
                wall_pos = (ray * SCALE, HALF_HEIGHT - proj_height // 2)
            else:
                texture_height = TEXTURE_SIZE * HEIGHT / proj_height
                wall_column = self.textures[texture].subsurface(
                    offset * (TEXTURE_SIZE - SCALE), HALF_TEXTURE_SIZE - texture_height // 2,
                    SCALE,  texture_height
                )
                wall_column = pg.transform.scale(wall_column, (SCALE, HEIGHT))
                wall_pos = (ray * SCALE, 0)

            self.objects_to_render.append((depth, wall_column, wall_pos))

    def ray_cast(self):
        self.ray_casting_result = []
        ox, oy = self.game.player.pos
        x_map, y_map = self.game.player.map_pos

        texture_vert, texture_hor = 1, 1

        ray_angle = self.game.player.angle - HALF_FOV + 0.0001
        for ray in range(NUM_RAYS):
            sin_a = math.sin(ray_angle)
            cos_a = math.cos(ray_angle)

            #horizontals
            y_hor, dy = (y_map + 1, 1) if sin_a > 0 else (y_map - 1e-6, -1)

            depth_hor = (y_hor - oy) / sin_a
            x_hor = ox + depth_hor * cos_a

            delta_depth = dy / sin_a
            dx = delta_depth * cos_a

            for i in range(MAX_DEPTH):
                tile_hor = int(x_hor), int(y_hor)
                if tile_hor in self.game.map.world_map:
                    texture_hor = self.game.map.world_map[tile_hor]
                    break
                x_hor += dx
                y_hor += dy
                depth_hor += delta_depth

            # verticals
            x_vert, dx = (x_map + 1, 1) if cos_a > 0 else (x_map - 1e-6, -1)

            depth_vert = (x_vert - ox) / cos_a
            y_vert = oy + depth_vert + sin_a

            delta_depth = dx / cos_a
            dy = delta_depth * sin_a

            for i in range(MAX_DEPTH):
                tile_vert = int(x_vert), int(y_vert)
                if tile_vert in self.game.map.world_map:
                    texture_vert = self.game.map.world_map[tile_vert]
                    break
                x_vert += dx
                y_vert += dy
                depth_vert += delta_depth

            # depth, texture offset
            if depth_vert < depth_hor:
                depth, texture = depth_vert, texture_vert
                y_vert %= 1
                offset = y_vert if cos_a > 0 else (1 - y_vert)
            else:
                depth, texture = depth_hor, texture_hor
                x_hor %= 1
                offset = (1 - x_hor) if sin_a > 0 else x_hor

            # remove fishbowl effect
            depth *= math.cos(self.game.player.angle - ray_angle)

            # projection
            proj_height = SCREEN_DIST / (depth + 0.0001)

            #ray casting result
            self.ray_casting_result.append((depth, proj_height, texture, offset))

            ray_angle += DELTA_ANGLE

    def update(self):
        self.ray_cast()
        self.get_objects_to_render()


问:
Dropbox SDK React-Native
I have react-native app for mobile and web. I have Dropbox section that I need to connect with backend. On toggle button I need to show Dropbox button and when I click on button show modal to signIn.

```<code><View style={{ paddingHorizontal: 15 }}>
    <AccordionComponent label="DropBox" type="toggle" content={<></>} />
            <Button
            onPress={onDropboxPress}
            style={styles.dropboxButton}
            textStyle={styles.dropButtonText}
            text={t('DropboxNormal')}
            iconPath={require('@assets/icons/dropbox.png')}
            iconStyle={styles.dropIcon}
            loading={savingIDropUser === ILoadingState.LOADING}
        />
  </View>
</code>```

I found this

https://github.com/dropbox/dropbox-sdk-js

but don't know how to use it.

Title: Dropbox SDK React-Native

Body:
I have react-native app for mobile and web. I have Dropbox section that I need to connect with backend. On toggle button I need to show Dropbox button and when I click on button show modal to signIn.

<View style={{ paddingHorizontal: 15 }}>
    <AccordionComponent label="DropBox" type="toggle" content={<></>} />
            <Button
            onPress={onDropboxPress}
            style={styles.dropboxButton}
            textStyle={styles.dropButtonText}
            text={t('DropboxNormal')}
            iconPath={require('@assets/icons/dropbox.png')}
            iconStyle={styles.dropIcon}
            loading={savingIDropUser === ILoadingState.LOADING}
        />
  </View>

I found this

https://github.com/dropbox/dropbox-sdk-js

but don't know how to use it.


问:
Stop Framer Motion's useScroll from affecting two instances of the same component simultaneously
I'm creating a sticky container with a nested element that animates a component's x position based on the users scroll position with Framer Motion.

I put it all together and thought it was working until I rendered out two instances of the same component. Both are currently animating at the same time but I want them to behave independently and only start their respective animation when they're visible in the viewport.

I believe my issue is down to how I've set up useScroll as I believe it's tracking the entire page rather than the motion component within it's container. I'm reading through the docs on Framer Motion and there are two options within useScroll that I've been toying with to try and get it to work target and container.

Below is a stripped down version demonstrating the useRef, useScroll, and the HTML:

```<code>  const ref = useRef(null);

  const { scrollY } = useScroll({ target: ref });
</code>```
```<code>    <section className="container" ref={ref}>
      <div className="galleryContainer">
        <div>
          <motion.div
            className="scrollingContainer"
            style={{ x: xPercent }}
            transition={{ type: "inertia", velocity: 50 }}
          >
            test
          </motion.div>
        </div>
      </div>
    </section>
</code>```

The FM docs state that "To track the scroll position of a scrollable element, instead of that of the page, we can pass a ref to both useScroll's container option and the element." but my parent container is not a scrollable element and when I set container: ref rather than target: ref the animation stops working altogether, I'm unsure of where to go from here.

I've set up a Code Sandbox to demonstrate the current behaviour:

https://codesandbox.io/s/framer-motion-parallax-forked-jv8w4i?file=/src/App.tsx

Any advice would be greatly appreciated.

Body:
I'm creating a sticky container with a nested element that animates a component's x position based on the users scroll position with Framer Motion.

I put it all together and thought it was working until I rendered out two instances of the same component. Both are currently animating at the same time but I want them to behave independently and only start their respective animation when they're visible in the viewport.

I believe my issue is down to how I've set up useScroll as I believe it's tracking the entire page rather than the motion component within it's container. I'm reading through the docs on Framer Motion and there are two options within useScroll that I've been toying with to try and get it to work target and container.

Below is a stripped down version demonstrating the useRef, useScroll, and the HTML:

  const ref = useRef(null);

  const { scrollY } = useScroll({ target: ref });

          <motion.div
            className="scrollingContainer"
            style={{ x: xPercent }}
            transition={{ type: "inertia", velocity: 50 }}
          >
            test
          </motion.div>

The FM docs state that "To track the scroll position of a scrollable element, instead of that of the page, we can pass a ref to both useScroll's container option and the element." but my parent container is not a scrollable element and when I set container: ref rather than target: ref the animation stops working altogether, I'm unsure of where to go from here.

I've set up a Code Sandbox to demonstrate the current behaviour:

https://codesandbox.io/s/framer-motion-parallax-forked-jv8w4i?file=/src/App.tsx

Any advice would be greatly appreciated.


问:
Avdmanager command not found
I'm trying to create a custom AVD from cmdl on CodeMagic CI Linux machine because I have no access to the avdmanager GUI, but I'm getting this error
avdmanager: command not found

The command:

```<code>$ANDROID_SDK_ROOT/cmdline-tools/latest/bin avdmanager create avd -n pixel2 -k pixel2 "system-images;android-28;google_apis;x86_64" --device "Pixel 2"
</code>```

And i tried to run it in both tools path and cmdline-tools path of Android SDK

Title: Avdmanager command not found

Body:
I'm trying to create a custom AVD from cmdl on CodeMagic CI Linux machine because I have no access to the avdmanager GUI, but I'm getting this error
avdmanager: command not found

The command:

$ANDROID_SDK_ROOT/cmdline-tools/latest/bin avdmanager create avd -n pixel2 -k pixel2 "system-images;android-28;google_apis;x86_64" --device "Pixel 2"

And i tried to run it in both tools path and cmdline-tools path of Android SDK


问:
Runtime-dom error with vue-suspense and RouterView
I have got Bug and I dont know how to fix it.

I use vue-router with suspense for async components. Use it like in the documentation:
https://vuejs.org/guide/built-ins/suspense.html#combining-with-other-components

<RouterView v-slot="{ Component }">
  <template v-if="Component">
    <Transition mode="out-in">
      <KeepAlive>
        <Suspense>

          <component :is="Component"></component>

          <template #fallback>
            Loading...
          </template>
        </Suspense>
      </KeepAlive>
    </Transition>
  </template>
</RouterView>
```
<p>But when I quickly switch paths or a hot reload is caused, the following error is caused:</p>
<pre class="lang-js prettyprint-override"><code>runtime-dom.esm-bundler.js:35 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')
    at parentNode (runtime-dom.esm-bundler.js:35:30)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5713:17)
    at ReactiveEffect.run (reactivity.esm-bundler.js:187:25)
    at instance.update (runtime-core.esm-bundler.js:5745:56)
    at callWithErrorHandling (runtime-core.esm-bundler.js:157:36)
    at flushJobs (runtime-core.esm-bundler.js:390:17)
</code>```

It seems to get fixed, when I wrap the component in a div. But I dont need that:

...

  <component :is="Component"></component>

...
```
<p>Anyone some Idea or can help me? Thanks :)</p>
``````

Body:
I have got Bug and I dont know how to fix it.

I use vue-router with suspense for async components. Use it like in the documentation:
https://vuejs.org/guide/built-ins/suspense.html#combining-with-other-components

<RouterView v-slot="{ Component }">
  <template v-if="Component">
    <Transition mode="out-in">
      <KeepAlive>
        <Suspense>

          <component :is="Component"></component>

          <template #fallback>
            Loading...
          </template>
        </Suspense>
      </KeepAlive>
    </Transition>
  </template>
</RouterView>

But when I quickly switch paths or a hot reload is caused, the following error is caused:

runtime-dom.esm-bundler.js:35 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')
    at parentNode (runtime-dom.esm-bundler.js:35:30)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5713:17)
    at ReactiveEffect.run (reactivity.esm-bundler.js:187:25)
    at instance.update (runtime-core.esm-bundler.js:5745:56)
    at callWithErrorHandling (runtime-core.esm-bundler.js:157:36)
    at flushJobs (runtime-core.esm-bundler.js:390:17)

It seems to get fixed, when I wrap the component in a div. But I dont need that:

...

  <component :is="Component"></component>

...

Anyone some Idea or can help me? Thanks :)


问:
Python - Run multiprocessing procedure by oracle connector
I have procedures in oracle database and currently they run with python, one by one with a for loop.

for exanmple:

```<code>procedures = ['A','B','C']

for procedure in procedures:
    oracle_connector.run_procedure(connection,procedure,proccess)
</code>```

I want to use multiprocessing but I don't know how or if it is possible.

I understand the basic, like:

```<code>import multiprocessing

if __name__ = '__main__'
   process = multiprocessing.Process(target=task)
   process.start()
</code>```

but I don't know what can I put in the target.

what I am trying to say is, how can I make this work or if it is even possible:

```<code>multiprocessing.proccess(target =  oracle_connector.run_procedure(connection,procedure_name,proccess))
</code>```

Thanks for the help!

Body:
I have procedures in oracle database and currently they run with python, one by one with a for loop.

for exanmple:

procedures = ['A','B','C']

for procedure in procedures:
    oracle_connector.run_procedure(connection,procedure,proccess)

I want to use multiprocessing but I don't know how or if it is possible.

I understand the basic, like:

import multiprocessing

if __name__ = '__main__'
   process = multiprocessing.Process(target=task)
   process.start()

but I don't know what can I put in the target.

what I am trying to say is, how can I make this work or if it is even possible:

multiprocessing.proccess(target =  oracle_connector.run_procedure(connection,procedure_name,proccess))

Thanks for the help!


问:
Cassandra query fails when I add more parameters to WHERE clause
I've tried to run the following query on a database I'm working on:

```<code>sql_query = "SELECT * FROM x.y WHERE box=" + boxID + " and tag='notification';"
</code>```

This query seemed to work, but after some iterations with different boxIDs, it started to fail, raising the following exception:
 cassandra.ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] message="Operation failed - received 0 responses and 1 failures" info={'consistency': 'LOCAL_ONE', 'required_responses': 1, 'received_respons es': 0, 'failures': 1}.
Not knowing how to proceed, I tried to remove the tag clause, resulting in the following query:

```<code>sql_query = "SELECT * FROM chronicles.box_botany WHERE box=" + boxID + ";"
</code>```

which, to my surprise, doesn't raise the exception anymore.
Shouldn't making the WHERE clause more specific speed up the process?
How much slower is checking for that specific condition in python compared to checking it with cassandra? Why did the starting query work with some IDs, but failed with others?

In case it helps, I'm working on cassandra through python. These are the step I follow to setup the connection with the database:

```<code>auth_provider = PlainTextAuthProvider(username=CASSANDRA_USER, password=CASSANDRA_PASS)
cluster = Cluster(contact_points=[CASSANDRA_HOST], port=CASSANDRA_PORT,auth_provider=auth_provider)
session = cluster.connect(CASSANDRA_DB)
session.row_factory = dict_factory
</code>```

Then to retrieve the results and work on them I do the following:

```<code>for row in session.execute(sql_query):
  #stuff
</code>```

Body:
I've tried to run the following query on a database I'm working on:

sql_query = "SELECT * FROM x.y WHERE box=" + boxID + " and tag='notification';"

This query seemed to work, but after some iterations with different boxIDs, it started to fail, raising the following exception:
 cassandra.ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] message="Operation failed - received 0 responses and 1 failures" info={'consistency': 'LOCAL_ONE', 'required_responses': 1, 'received_respons es': 0, 'failures': 1}.
Not knowing how to proceed, I tried to remove the tag clause, resulting in the following query:

sql_query = "SELECT * FROM chronicles.box_botany WHERE box=" + boxID + ";"

which, to my surprise, doesn't raise the exception anymore.
Shouldn't making the WHERE clause more specific speed up the process?
How much slower is checking for that specific condition in python compared to checking it with cassandra? Why did the starting query work with some IDs, but failed with others?

In case it helps, I'm working on cassandra through python. These are the step I follow to setup the connection with the database:

auth_provider = PlainTextAuthProvider(username=CASSANDRA_USER, password=CASSANDRA_PASS)
cluster = Cluster(contact_points=[CASSANDRA_HOST], port=CASSANDRA_PORT,auth_provider=auth_provider)
session = cluster.connect(CASSANDRA_DB)
session.row_factory = dict_factory

Then to retrieve the results and work on them I do the following:

for row in session.execute(sql_query):
  #stuff


问:
Hide out of stock products if meta key does not exist
I am working on a store with woocommerce plugin and need to hide out of stock products which I did with “Hide out of stock items from the catalog” setting but I need to show products with certain meta data even if they are out of stock.

I have tried adding meta_query using woocommerce_product_query hook but that seems to result in empty product list.

```<code>add_action( 'woocommerce_product_query',function( $q ){
    $meta_query = (array) $q->get( 'meta_query' );
    $meta_query['relation'] = 'OR';
    $meta_query[] = [
        'key' => '_show_if_out_of_stock',
        'value' => 'yes',
         'compare' => '='
    ];
    $q->set( 'meta_query', $meta_query );
},99);
</code>```

I also noticed enabling  "Hide out of stock items from the catalog" adds tax_query with NOT IN operator and I am guessing with added meta_query woocommerce tries to find products that matches both which results in empty product list.

Can anyone please help me ?

Thanks in Advance

Body:
I am working on a store with woocommerce plugin and need to hide out of stock products which I did with “Hide out of stock items from the catalog” setting but I need to show products with certain meta data even if they are out of stock.

I have tried adding meta_query using woocommerce_product_query hook but that seems to result in empty product list.

add_action( 'woocommerce_product_query',function( $q ){
    $meta_query = (array) $q->get( 'meta_query' );
    $meta_query['relation'] = 'OR';
    $meta_query[] = [
        'key' => '_show_if_out_of_stock',
        'value' => 'yes',
         'compare' => '='
    ];
    $q->set( 'meta_query', $meta_query );
},99);

I also noticed enabling  "Hide out of stock items from the catalog" adds tax_query with NOT IN operator and I am guessing with added meta_query woocommerce tries to find products that matches both which results in empty product list.

Can anyone please help me ?

Thanks in Advance


问:
Reliable Online Manual Copy Tool
I often have to develop projects where no internet is available.

Unfortunately, more and more programs no longer have offline manuals.

What is the best way to copy an online help locally? HTTrack Website Copier fails very often.

Which windows tool is the most reliable?

Thank you for the suggestions.

Title: Reliable Online Manual Copy Tool


问:
p4merge not working on git version 2.31.1
My environment is: Centos Stream 9

I'm trying to use p4merge as diff tool but when I use:

git difftool --tool-help

I get:

```<code>'git difftool --tool=<tool>' may be set to one of the following:
                vimdiff
                vimdiff1
                vimdiff2
                vimdiff3

The following tools are valid, but not currently available:
                araxis
                bc
                bc3
                bc4
                codecompare
                deltawalker
                diffmerge
                diffuse
                ecmerge
                emerge
                examdiff
                guiffy
                gvimdiff
                gvimdiff1
                gvimdiff2
                gvimdiff3
                kdiff3
                kompare
                meld
                nvimdiff
                nvimdiff1
                nvimdiff2
                nvimdiff3
                opendiff
                smerge
                tkdiff
                winmerge
                xxdiff

Some of the tools listed above only work in a windowed
environment. If run in a terminal-only session, they will fail.
</code>```

Ther is not p4merge entry.
I don't understand why, and how I can arrange it.

If you look at:
https://git-scm.com/docs/git-config/2.31.1
You will see p4merge is in the possible options.

Do you know why or how it can be used?

Thanks

I want to use p4merge as difftool and diffmerge tool.

Body:
My environment is: Centos Stream 9

I'm trying to use p4merge as diff tool but when I use:

git difftool --tool-help

I get:

'git difftool --tool=<tool>' may be set to one of the following:
                vimdiff
                vimdiff1
                vimdiff2
                vimdiff3

The following tools are valid, but not currently available:
                araxis
                bc
                bc3
                bc4
                codecompare
                deltawalker
                diffmerge
                diffuse
                ecmerge
                emerge
                examdiff
                guiffy
                gvimdiff
                gvimdiff1
                gvimdiff2
                gvimdiff3
                kdiff3
                kompare
                meld
                nvimdiff
                nvimdiff1
                nvimdiff2
                nvimdiff3
                opendiff
                smerge
                tkdiff
                winmerge
                xxdiff

Some of the tools listed above only work in a windowed
environment. If run in a terminal-only session, they will fail.

Ther is not p4merge entry.
I don't understand why, and how I can arrange it.

If you look at:
https://git-scm.com/docs/git-config/2.31.1
You will see p4merge is in the possible options.

Do you know why or how it can be used?

Thanks

I want to use p4merge as difftool and diffmerge tool.