sharepoint online – ItemAdded remote event Receiver return clientcontext Null working fine other same level webs pages library

ItemAdded remote event Receiver return clientcontext Null working fine on other same level webs pages library, i used TokenHelper class for get content on behalf of current login user, i tried to use Admin account as well if Client context null but that also not work , i tried to detach and attach again on new libraries but still null.

I tried below ways but no success:

  1. ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties)

working fine in other webs but not working on new Web Library under same site collection.

  1. // obtain web URL somehow – line below is fine for a list item RER, but you’ll need another approach elsewhere:
string webUrl = properties.ItemEventProperties.WebUrl;

Uri webUri = new Uri(webUrl);

string realm = TokenHelper.GetRealmFromTargetUrl(webUri); 
string accessToken = TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, webUri.Authority, realm).AccessToken; 
using (var clientContext = TokenHelper.GetClientContextWithAccessToken(webUrl, accessToken))  
    // do CSOM stuff here..

this way showing item may be deleted or checkout by other user.

Please let me know if any other way to fix this issue .

postgresql – Insert results from query, update old existing row if query doesn’t still return same value

I am trying to refactor a table which contains historical data and therefore isn’t ever deleted, but has an ‘active’ field.

Each day we run a query (a few joins, but quite slow) to get some data to insert into this table:

  • if the row exists already, and is present in the query, we do nothing
  • if the row exists but the result isn’t in todays query, we set ‘active’ to false
  • if the row doesn’t exist but is in the query, we insert it (with active defaulting to true)

It is possible for an entity to be active, made inactive (same row), then a few days later become active again (would be a new row).

The table is using a surrogate key, as the natural key can be repeated as noted above, though there should only ever be a single entry that is active on the natural key.

I’m curious if there is an action or ‘pattern’ I can take that will enable such functionality – I realise I’m asking a lot 🙂

I am using a java library (jOOQ) to generate the sql, so I am only looking for sql as the solution, no PL/pgSQL and no stored procs. I doubt it is possible without 2 passes (1. perform the update where not in query result, 2. perform the insert from query result) but I’m intrigued if there are possibilities.

t sql – Execute SSIS (package) in SSMS using T-SQL and return a value

Using VS (2019) I created an Integration Services Project to code an SSIS package. The goal was to call a Web API from an SSIS package using input variables like username/password/url and so on. I successfully achieved this using Script Task and Dts.Variables and F5/Run to see successful results. What I want to achieve now is to return (like an out parameter) an Id returned to me by the Web API. I want to have this Id returned in the SSMS Results window when I execute the SSIS script in SSMS.

Here is what I have done:

  1. VS > Open dtsx file in Designer and in the “Control Flow” tab, right clicked to add variable:

enter image description here

enter image description here

  1. Right clicked the Script Task I had created and added the variable created above in the ReadWriteVariables section:

enter image description here

  1. Using “Edit Script” to code the Web API call and return a value and set it as follows:

    Dts.Variables(“User::Id”).Value = Convert.ToInt32(id);

The MessageBox was just to test if the id is returned by the Web API and I get an alert of the “id” when I Run/F5 the SSIS project in Visual Studio. The second line is where I have set the Variable.

  1. I execute the SSIS in using T-SQL in SSMS from an example here:

    Declare @execution_id bigint

    EXEC (SSISDB).(catalog).(create_execution) @package_name=N’ssisWAP.dtsx’, @execution_id=@execution_id OUTPUT, @folder_name=N’SSIFolder’, @project_name=N’SampleProject’, @use32bitruntime=False, @reference_id=Null

    Select @execution_id

    DECLARE @var0 sql_variant = N’username’

    EXEC (SSISDB).(catalog).(set_execution_parameter_value) @execution_id, @object_type=20, @parameter_name=N’Username’, @parameter_value=@var0

    DECLARE @var1 sql_variant = N’password’

    EXEC (SSISDB).(catalog).(set_execution_parameter_value) @execution_id, @object_type=20, @parameter_name=N’Password’, @parameter_value=@var1

    EXEC (SSISDB).(catalog).(start_execution) @execution_id

The above executes properly, calling the API and an out @execution_id is shown in Result window. But no sign of the variables User::Id I created earlier. Is it possible to show that value in the Result window? If not, is there a way to see that the data in that variable in SSMS after SSIS execution (even from designer)?

I already had a look at this post:

where the solution is to use “Execute SQL Task” and “pass” the variable into a procedure. This I guess is one way to do it but I want to just get the Id in the return when I execute the script as shown above.

Any help will be appreciated. Thanks

lo.logic – The Return of Graham Arithmetics: adding induction up to $g_{64}$

In my previous question The inconsistency of Graham Arithmetics plus $ forall n, n < g_{64}$, I introduced an extension of Robinson Arithmetics with the recursive definition of Tetraction, a small fragment of arithmetics which I have christened Graham (if someone comes up with a better name, please enter it in comments).

I have also added an axiom which makes it (in the conventional sense) inconsistent, by stipulating that Graham number is inaccessible. Thanks to the magnificient answers of Emil Jerabek and Fedor Pakhomov I have a better idea on how much it takes to prove its inconsistency, and how.

Here, let us remove the inaccessibility of Graham number, and add instead a limited induction. Not in the ordinary sense of fragments of arithmetic, which entails restricting the type of formulae for which induction is acceptable.

Rather, I want induction UP TO $g_{64}$:given a formula $A(x)$

$ A(0)land (A(x) rightarrow A(Sx) rightarrow forall x (x<g_{64} rightarrow A(x))$

So, here Graham number is inaccessible in the sense that induction (without any restriction on A(x)) is limited to all terms which are below it.

Now my question:

Clearly Graham plus limited induction proves things which are provable in PA (it is a “straightjacketed” version of PA, if I may say so). But what else can PA prove about the finite initial segment of numbers below $g_{64}$ beyond what the theory above knows?

rest api – WooCommerce return related products

I’m making a mobile app for my store.
What I want is that I when fetch the products from REST API, it should not just contain the related_ids but I just want to add an extra property to each product and that is related_products which should hold the actual product data of those related ids.

Because loading each related products separately is cumbersome user experience.
How can I customize the REST API to include the related_products property ?
Thanks in advance

How do I fix WHS 2011 failing to install KB4535102; return code 80092004?

I am seeing this error…
install error

for this update…
update details

How do I get the update to install correctly?

“no cache-control” request but sometimes get a http 204 return code

I have a client software that sends a HTTP request with “Cache-Control: no-cache”, but sometimes, I will get a HTTP return code 204. I also try “Cache-Control: no-store”, same thing happened sometimes. Is this I misunderstanding the use of “Cache-Control”? My goal is restricted server only return 200, no 204.

magento2 – Missing ‘return’ statement in frontend Controller execute() method (IDE warning notice)

I recently use PhpStorm to write my code and it finds an error in a controller who get data from a <form> to save them in a custom model. (works fine even without correction).

Class StockRequestForm extends MagentoFrameworkAppActionAction
    public function __construct(....) 

     * @inheritDoc
    public function execute()
        $resultRedirect = $this->resultFactory->create(MagentoFrameworkControllerResultFactory::TYPE_REDIRECT);
        if (!$this->helper->getFormKeyValidation($this->getRequest())) {
          $this->messageManager->addErrorMessage('Invalid request!');
          return $resultRedirect->setRefererOrBaseUrl();

        $post = (array)$this->getRequest()->getPost();
        if (!empty($post)) {
            try {
                ... // saving $model
                $this->messageManager->addSuccessMessage(__('You're request have been submitted.'));
                return $resultRedirect->setRefererOrBaseUrl();
            } catch (Exception $e) {
                return $resultRedirect->setRefererOrBaseUrl();

    } // here the missing 'return' statement !

Return of Experiences (ROX)

What process and metrics, do you already have the opportunity to implement or see in small or big companies that worked?

dnd 5e – How to make a handaxe return to my hand after being thrown?

Eldritch Knight (Fighter subclass) gets at 3rd level Weapon Bond which includes:

Once you have bonded a weapon to yourself, you can’t be disarmed of that weapon unless you are incapacitated. If it is on the same plane of existence, you can summon that weapon as a bonus action on your turn, causing it to teleport instantly to your hand.

You can have two such weapons, but it does eat into your action economy a bit.

A 2nd level Artificer (Eberron:RftLW p. 63) has access to the Returning Weapon Infusion which includes

(The weapon) returns to the wielder’s hand immediately after it is used to make a ranged attack.

Notably, you can only have one instance of a given infusion going, though if you’re able to have two artificer’s at work, should be able to get it on both. Though, as Eberron content may not be applicable to a campaign, Ask your DM is Artificer is right for you.

A number of magic items do things similar to what you want, but acquiring one will obviously require cooperation from your DM and reskinning them to an axe doubly so.

Dwarven Thrower and Whelm

The very rare warhammer Dwarven Thrower requires attunement by a Dwarf and returns to your hand after being thrown. If you’re set on your Dwarf using axes you DM may have one be an axe instead.

The legendary warhammer Whelm also return to your hand, and your DM might be persuaded to have Whelm be an axe in your campaign world.

Dancing Sword Axe

The magic item Dancing Sword returns to your hand after being throw/it’s done flying around, and could easily be reskinned as an axe.