2016 – How to prevent SharePoint site page refresh itself when jquery .load is triggered?

I have a simple SharePoint site page (created in Site Page library). I added a simple jquery syntax here:

<script>
$(function() {
$("#button_overview").on("click", function(){   $("#homepagecontent").load("../description/overview.htm");   });

});
</script>

When I click the button, overview.htm is loaded for 1 sec and the entire page is refreshed. It cause the page render back to previous stage.

I have also tried .html("<p>hello</p>"). The result is “hello” show up for 1 sec and page is refreshed.

Is it default SharePoint behavior? How can I work around it?

unity – Why my Submit button not triggered once?

I have some issues for match the string and the InputField.text it’s triggering multiple times after Active or dead Active Gameobject when press Submit button(in this case is “Cek Jawaban”).

this my script

public void Answer(int index)
    {
        inputPanel.SetActive(true);

        inputField.text = "";

        inputPanel.transform.Find("KunciBtn").GetComponent<Button>().onClick.AddListener(() =>
        {
            if (inputField.text != "")
            {
                if (inputField.text == jawaban(index))
                {
                    Debug.Log("Right");
                }
                else
                {
                    Debug.Log("Wrong");

                }

                inputPanel.SetActive(false);
            }
            else
            {
                Debug.Log("jangan kosong");
            }
        });
    }

Many Buttons

enter image description here

enter image description here

as you can see on the console the first that trigger once but after second time its trigger twice.

equation – Why the stop Integration can not be triggered?

I use mma to solve this differential equation, But I find that the stop condition in WhenEvent can not be triggered, I want to know why.Thanks a lot.

`NDSolve({x1''(t) == 0, x2''(t) == 0, x1'(0) == v10, x2'(0) == v20, 
  x1(0) == x10, x2(0) == x20, 
  WhenEvent(x1(t) == x2(t) - 2*r, 
    {x1'(t), 
     x2'(t)} -> {-((-m1 *x1'(t) + e* m2 *x1'(t) - m2 *x2'(t) - 
       e *m2* x2'(t))/(
      m1 + m2)), -((-m1* x1'(t) - e* m1 * x1'(t) + e* m1 *x2'(t) - 
       m2 *x2'(t))/(m1 + m2))}), 
  WhenEvent(x1(t) == r, x1'(t) -> -x1'(t))}, {x1, x2}, {t, 0, 100})`

magento2.4 – Why does RMQ Topic handler is never triggered?

I’m getting stuck with my Topic Handler in Magento.

I have a working RMQ consumer, I can read message on the Queue, no problem.

Here is the communication.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <topic name="shipmentQueue" request="string" response="string">
        <handler name="shipmentQueueShippingRequestHandler" type="AcmeMessageQueueRequestHandlerShippingRequestHandler" method="process"/>
    </topic>
</config>

Here is the ShippingRequestHandler class:

<?php

namespace AcmeMessageQueueRequestHandler;

class ShippingRequestHandler
{
    /**
     * @param string $simpleDataItem
     * @return string
     */
    public function process($simpleDataItem)
    {
        echo __LINE__." $simpleDataItem ";
    }
}

And here is my queue_consumer.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <consumer
        name="shipmentQueue.consumer"
        queue="shipmentQueue"
        connection="amqp"
        handler="AcmeMessageQueueConsumerOrderExport::shippingProcess"/>
</config>

The OrderExport::shippingProcess() is correctly triggered, but the topic handler is never ever triggered, why ?

The main problem is that our rmq is sending JSON object and Magento want a String, so I want to process the queue message from JSON To string.

weapons – What is the Combat Drill’s mean damage and self-heat when its extra damage is triggered?

The Combat Drill weapon in Lancer, located on page 155 of the free version, has an unusual (at least within Lancer‘s system) damage-determination property that has stymied my attempts to calculate its average damage and heat.

For those unaware, the weapon, when rolling for damage, rerolls 1s as per its Overkill tag, dealing 1 heat (internal damage to a mech) to the user for each reroll. When the Combat Drill hits a target that is Immobilized, Prone, or Stunned and its Overkill tag is triggered (i.e. one of its dice rolls a 1), it deals an additional d6 of bonus damage. Damage dice that have already triggered this property can do so again and dice generated by this property can trigger it, theoretically leading to an exponentially increasing number of d6s of damage.

The drill deals 3d6 Kinetic damage and 1d6 Energy damage by default, but bonus damage is a type of the user’s choice from among already-dealt damage. How much damage is dealt on average by the drill when its secondary property is triggered? How much heat does the user take on average when the property is triggered?

python – Sound bound to Pyglet keyboard event handler plays the first time the event is triggered, but never again

I am working on an application which requires 3d audio support.
I looked around, and decided on Pyglet as the simplest python solution for this.
I wrote a simple program to test basic sound using only 1 player object (my application will play many sounds, and I need to do this to get around the OpenAL limit on the number of sources)), but, it doesn’t work.
When I hit a key, the sound plays the first time, but never again. Any help is appreciated.
Code:

import pyglet

window=pyglet.window.Window(width=200,height=200)
sound=pyglet.media.load("rock.wav",streaming=False)
player=pyglet.media.Player()
@window.event
def on_key_press(symbol,modifiers) :
    player.queue(sound)
player.play()
@window.event
def on_draw() :
    window.clear()
pyglet.app.run()

unreal 4 – Read actor instance’s text variable for widget when triggered on different objects

What I’m trying to do:
(a ‘long story version’ is linked in comment below)

(and another user example is hyperlinked in comment below – i couldn’t post over 8 images and/or links in this first comment*)
(there are other similar user questions elsewhere I know)

Short story: I’m trying to make a widget that is triggered by an actor blueprint, and I want the widget to display different text that reflects the public-variable-text edits I make in the editor.

My latest progress includes actors that are titled somewhat according to the hyperlinked user case above so, I have a “door_trigger” and a “doorWidget”. I have altered the pin connections so much that I am just going to copy and paste all my screen shots below.

I got to change text asset DoorName by making a public variable called “name,” as you’ll see. I can make the trigger show this text on screen and have it disappear when the user leaves the trigger actor, BUT EVERY INSTANCE ALSO SHOWS THIS TEXT VALUE, EVEN THOUGH I CHANGE IT

In the screenshots (some in comment following too) you’ll see the text “3” appear on screen, and it does this for all three of the dummy boxes I made; notice how the second box is supposed to show “dd” (I was just typing random filler content).

ALL HELP SO APPRECIATED!!!!! Thank you!!!

alt textalt textalt textalt textalt text

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

enter image description here
enter image description here

sql server – Key lock triggered by batch update

I’m doing a batch update operation,but it appears key lock I think I’m in trouble.
I don’t understand why the deadlock is happening.
enter image description here

Environment: SQL Server 2016

deadlock graph detailed:

<deadlock-list>
 <deadlock victim="process29617519088">
  <process-list>
   <process id="process29617519088" taskpriority="0" logused="0" waitresource="KEY: 14:72057594042122240 (aff034961e05)" waittime="2834" ownerId="59072177" transactionname="UPDATE" lasttranstarted="2021-04-12T16:50:19.377" XDES="0x295a2ef6e58" lockMode="U" schedulerid="7" kpid="7808" status="suspended" spid="91" sbid="2" ecid="0" priority="0" trancount="2" lastbatchstarted="2021-04-12T16:50:19.340" lastbatchcompleted="2021-04-12T16:50:19.343" lastattention="1900-01-01T00:00:00.343" clientapp="Core .Net SqlClient Data Provider" hostname="FENGL-PC" hostpid="1294251125" loginname="sa" isolationlevel="read committed (2)" xactid="59072177" currentdb="14" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
     <frame procname="adhoc" line="2" stmtstart="6" stmtend="942" sqlhandle="0x0200000010732f2ceb34267aaa1b31c44ae92e2ec57b3e1e0000000000000000000000000000000000000000">
unknown     </frame>
    </executionStack>
    <inputbuf>

 WITH Activitys AS (
 SELECT N'169489381063868436' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381059674113' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381013536784' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381017731089' AS Id,N'Name-2' AS Name,1 AS Version) 
UPDATE S
SET S.Name = T.Name,
S.Version = S.Version + 1
FROM dbo.ActivityDto S JOIN Activitys T ON S.(Id)=T.(Id) AND S.(Version)=T.(Version);
 IF @@ROWCOUNT=4 BEGIN SELECT CAST(0 AS BIGINT) AS Id,0 AS Version END ELSE BEGIN
 WITH Ids AS (
 SELECT N'169489381063868436' AS Id 
UNION ALL 
 SELECT N'169489381059674113' AS Id 
UNION ALL 
 SELECT N'169489381013536784' AS Id 
UNION ALL 
 SELECT N'169489381017731089' AS Id) 

 SELECT S.Id,S.Version FROM dbo.ActivityDto S  JOIN Ids T ON S.(Id)=T.(Id) END    </inputbuf>
   </process>
   <process id="process295a1298ca8" taskpriority="0" logused="0" waitresource="KEY: 14:72057594042122240 (075b1091eea1)" waittime="2826" ownerId="59071581" transactionname="UPDATE" lasttranstarted="2021-04-12T16:50:19.353" XDES="0x2959a542e58" lockMode="U" schedulerid="9" kpid="5136" status="suspended" spid="139" sbid="2" ecid="0" priority="0" trancount="2" lastbatchstarted="2021-04-12T16:50:19.337" lastbatchcompleted="2021-04-12T16:50:19.343" lastattention="1900-01-01T00:00:00.343" clientapp="Core .Net SqlClient Data Provider" hostname="FENGL-PC" hostpid="1294251125" loginname="sa" isolationlevel="read committed (2)" xactid="59071581" currentdb="14" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">
    <executionStack>
     <frame procname="adhoc" line="2" stmtstart="6" stmtend="1258" sqlhandle="0x020000006468c32fdcd8118755392016036171d4d3a33c1d0000000000000000000000000000000000000000">
unknown     </frame>
    </executionStack>
    <inputbuf>

 WITH Activitys AS (
 SELECT N'169489381063868437' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381013536775' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381013536789' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381063868431' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381009342465' AS Id,N'Name-2' AS Name,1 AS Version  
UNION ALL 
 SELECT N'169489381097422858' AS Id,N'Name-2' AS Name,1 AS Version) 
UPDATE S
SET S.Name = T.Name,
S.Version = S.Version + 1
FROM dbo.ActivityDto S JOIN Activitys T ON S.(Id)=T.(Id) AND S.(Version)=T.(Version);
 IF @@ROWCOUNT=6 BEGIN SELECT CAST(0 AS BIGINT) AS Id,0 AS Version END ELSE BEGIN
 WITH Ids AS (
 SELECT N'169489381063868437' AS Id 
UNION ALL 
 SELECT N'169489381013536775' AS Id 
UNION ALL 
 SELECT N'169489381013536789' AS Id 
UNION ALL 
 SELECT N'169489381063868431' AS Id 
UNION ALL 
 SELECT N'169489381009342465' AS Id 
UNION ALL 
 SELECT N'169489381097422858' AS Id) 

    </inputbuf>
   </process>
  </process-list>
  <resource-list>
   <keylock hobtid="72057594042122240" dbid="14" objectname="DbTest.dbo.ActivityDto" indexname="PK_ActivityDto" id="lock296177e3c80" mode="U" associatedObjectId="72057594042122240">
    <owner-list>
     <owner id="process295a1298ca8" mode="U"/>
    </owner-list>
    <waiter-list>
     <waiter id="process29617519088" mode="U" requestType="wait"/>
    </waiter-list>
   </keylock>
   <keylock hobtid="72057594042122240" dbid="14" objectname="DbTest.dbo.ActivityDto" indexname="PK_ActivityDto" id="lock295ac129d80" mode="U" associatedObjectId="72057594042122240">
    <owner-list>
     <owner id="process29617519088" mode="U"/>
    </owner-list>
    <waiter-list>
     <waiter id="process295a1298ca8" mode="U" requestType="wait"/>
    </waiter-list>
   </keylock>
  </resource-list>
 </deadlock>
</deadlock-list>

Activitydto table script

CREATE TABLE (dbo).(ActivityDto)(
    (Id) (bigint) NOT NULL,
    (ProcInstId) (bigint) NULL,
    (Name) (nvarchar)(500) NULL,
    (Version) (int) NULL,
 CONSTRAINT (PK_ActivityDto) PRIMARY KEY CLUSTERED 
(
    (Id) ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON (PRIMARY)
) ON (PRIMARY)
GO

I looked at two SQL statements and found no duplicate key, So I don’t understand what this is. Please let me know

2021-04-12 add:

lock res

waitresource="KEY: 14:72057594042122240 (aff034961e05)"

lockResKey Id ProcInstId
(aff034961e05) 169489381013536784 169489376328499300

waitresource="KEY: 14:72057594042122240 (075b1091eea1)"

lockResKey Id ProcInstId
(075b1091eea1) 169489381059674113 169489376324304968

execution plan:

https://www.brentozar.com/pastetheplan/?id=Hyd-39WUd

Explain SQL:
I will combine multiple pieces of data that need to be updated to form an update table, and then connect them together to do the update operation. If the number of affected rows is equal to the number of rows that I need to update, it means that all data updates are successful. If not, it means that some data updates fail. I need to query the current status of the data and return it to the program

thank

PostgreSQL cascading triggers based on the condition of which other table triggered it or a value given by the other trigger?

I want to keep (slightly different) tables synced to one another and with only 2 tables, this is fine. Because of pg_trigger_depth() = 0 in the WHEN clause they will not trigger each other.

I currently have the following database triggers defined:

Table From Trigger Table To
V1 V1 -> V2 V2
V2 V2 -> V1 V1

But I now want to have a V3 (or even more, V4, V5) table that also has to be synced. I want the triggers to trigger after one another but only in the right direction, e.g. V1 -> V2 -> V3, V3 -> V2 -> V1 or when V2 gets an insert/update/delete from V2 to V3 and from V2 to V1.

So my question is is it possible to come up with a solution that if V1 gets an insert/update/delete it first updates V2 and then only triggers the trigger from V2 -> V3 and not also the one from V2 back to V1.

I was thinking of some kind of ‘forwards’ and ‘backwards’ value when pg_trigger_depth() is not 0. Because a trigger is always either forward or backwards it can maybe be built into the trigger that it only triggers other ‘forwards’ or ‘backwards’ triggers when pg_trigger_depth() > 0.

Table From Trigger Table To
V1 V1 -> V2 V2
V2 V2 -> V1 V1
V2 V2 -> V3 V3
V3 V3 -> V2 V2
V4 V4 -> V5 V5
V5 V5 -> V4 V4

A different solution I can think of is to make a trigger from every table to every other table but this can quickly become too much when a new, for example V5, table gets added. In the above question only 2 triggers will have to be defined, but in this case 8 new triggers with slightly different changes will have to be made.