laptop – How to Fix Inverted Keyboard Event? (followed by continuous typing malfunction)

My keyboard just malfunctioned, and currently I can’t conclude is this software or hardware related issues. One key of my keyboard, “W” keeps autotyping like


and when I checked with an event listener application, the event seems inverted. It recorded keydown as keyup, and vice versa, and therefore it keeps typing when I leave the key on keyup, because it thinks that I hold the key down, and that’s probably the cause.

I’ve tried uninstalling the driver, and do some cleaning on my keyboard, but it not worked.

How can I fix this?

— Additional info

This is how a normal keys event look like

This is how my “W” key event look like (Followed by a Space to stop loop)

Both are tested with a single type event (fast key-down and key-up).

security – How we can secure the ClientID & ClientSecret inside our remote event receivers (Inside SharePoint Provider hosted app)

I have developed many remote event receivers and host them inside azure web apps. now the web.config file inside those remote event receivers contain the ClientId & ClientSecret, as follow:-

 <appSettings file="custom.config">
    <add key="ClientId" value="e***7" />
    <add key="ClientSecret" value="h***g=" />

Now if a hacker or an end user found those values inside the project code, then the user can control all the sites, as when we register the remote event receivers we grant them full control on the site collection.. so any advice how we can secure those details? so if someone access the source code of the RER then she/he can not view those details?


Azure Event Hub vs Event Grid or something else?

I have a timer function that calls a group of APIs asynchronously and then converts the XML responses to SQL Server records to an on premises database. I want to send a message in case there is a failure in the response so that I can retry the API call. After reading the documentation for Event Hubs and Event Grids, I’m not sure if either one of those options satisfies my requirement. The following is the documentation I’ve read:

Any insight would be appreciated.

development – I am no longer able to debug/run my SharePoint Remote Event Receiver locally using Ngrok

Last month the below steps were working well for me to debug and test a SharePoint online remote event receiver locally:-

  1. Open Ngrok.exe >> run the following command inside ngrok:-
 ngrok authtoken 3***e
 ngrok http --host-header=rewrite  57269
  1. register a new app:- @ >> enter the above Ngrok urls inside the App Redirect URL & App Domain.

  2. Inside the _layouts/15/appinv.aspx >> I search for the above app using Client ID >> and enter the following:-

 <AppPermissionRequests AllowAppOnlyPolicy="true">
   <AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
  1. Update the service’s web config with the above ClientID and ClientSecret

  2. Register the new remove event receiver as follow:-

 Add-PnPEventReceiver -List "Order Management" -Name "TasksRER" -Url -EventReceiverType ItemUpdated -Synchronization Asynchronous

But today when I tried the above steps it failed >> where inside my event receiver when I tried to get the SharePoint context >> I will get that the Context is null:-

  public void ProcessOneWayEvent(SPRemoteEventProperties properties)
             var prop = properties;
             var listItemID = properties.ItemEventProperties.ListItemId;
             var listTitle = properties.ItemEventProperties.ListTitle;
             using (ClientContext context = Helpers.GetAppOnlyContext(properties.ItemEventProperties.WebUrl))

Here is a screen shot from Visual Studio with the error i am getting when trying to get the context:-

enter image description here

Any advice if anything has been changed which is preventing me from running the above steps? which were working well last month?

here is the code for the GetAppOnlyContext

     public class Helpers
             public static ClientContext GetAppOnlyContext(string siteUrl)
                     Uri siteUri = new Uri(siteUrl);
                     string realm = TokenHelper.GetRealmFromTargetUrl(siteUri);
                     string accessToken = TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, siteUri.Authority, realm).AccessToken;
                     return TokenHelper.GetClientContextWithAccessToken(siteUri.ToString(), accessToken);
                 catch (Exception ex)
                     Trace.TraceInformation("GetAppOnlyContext failed. {0}", ex.Message);
                 return null;
             public static ClientContext GetAuthenticatedContext(string siteUrl)
                 string userName = WebConfigurationManager.AppSettings.Get("AuthenticatedUserName");
                 string password = WebConfigurationManager.AppSettings.Get("AuthenticatedUserPassword");
                 return GetAuthenticatedContext(siteUrl, userName, password);
             public static ClientContext GetAuthenticatedContext(string siteUrl, string userName, SecureString password)
                 ClientContext ctx = new ClientContext(siteUrl);
                 ctx.Credentials = new SharePointOnlineCredentials(userName, password);
                 return ctx;
             public static ClientContext GetAuthenticatedContext(string siteUrl, string userName, string password)
                 SecureString securePassword = GetPassword(password);
                 return GetAuthenticatedContext(siteUrl, userName, securePassword);
             private static SecureString GetPassword(string passwd)
                 var secure = new SecureString();
                 foreach (char c in passwd)
                 return secure;
             public static string EmptyIfNull(object obj)
                 return obj == null ? "" : obj.ToString();

seem this statement string accessToken = TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, siteUri.Authority, realm).AccessToken; inside my Helpers.GetAppOnlyContext will raise this error token request failed, as follow:-

enter image description here

Event and Emit in Solidity

Hope all doing well.
I want to do the following TWO activities in the SOLIDITY code written below:-
An ASAP help will be highly appreciable.
Thanks with regards


Emit an event ScoreChanged with two arguments: int amount (equal to the value that was sent) and bool direction (true for up function and false for down).

Emit an event GameEnded after gameOver is switched to true

Solidity code:-

pragma solidity ^0.4.17;

contract TugOfWar {

int public score = 0;
int constant endAt = 1 ether;
bool public gameOver = false;

function up() external payable {
    require(msg.value > 0);

    int value = int(msg.value);
    score += value;


function down() external payable {
    require(msg.value > 0);

    int value = int(msg.value);
    score -= value;



function checkIfGameOver() internal {
    if(score >= endAt || score <= endAt * -1) {
        gameOver = true;



dnd 5e – Does this lake event in the “Icewind Dale: Rime of the Frostmaiden” adventure allow a grapple as an opportunity attack?

There is an event in Icewind Dale: Rime of the Frostmaiden (an official D&D 5e adventure by Wizards of the Coast) that seems to allow for a grapple attack as an opportunity attack. In the Lake Events table on p. 30, it lists the following result for a roll of 15 on the d20:

A knucklehead trout (…) leaps out of the lake, makes a tail attack against one random character in the boat, and dives back into the frigid water. A character with a passive Wisdom (Perception) score of 13 or higher is not surprised by the fish and can use its reaction to make an opportunity attack against it or try to grapple the fish as it dives back into the water.

To me, this implies that the reaction is used to make an opportunity attack, but that attack can be substituted with the grapple special attack – which goes against the rules as written, which state that a grapple can only be done with the Attack action, not as an opportunity attack.

Now, if the character is before the fish on initiative, it could use the Ready action to ready an attack, then use that attack to grapple. But the text doesn’t mention Ready, nor does it state that the fish has lost initiative to the grappling character, which would be required to Ready a grapple. If the fish is earlier on initiative, the character could react with an opportunity attack but could not have an action (to grapple) already Readied.

Does this imply that you can grapple with an opportunity attack, or is it just a case of specific beats general, applying only to this specific fish-slap encounter?

Or is it just alluding to the Ready action, in a roundabout way? (If it is the Ready action, it requires the character was not surprised, rolled higher initiative, and correctly deduced that the fish was going to use a split move to approach, attack, and then retreat.)

Note: This situation does not follow the rules provided earlier for fishing for knucklehead.

unity – Should the interaction between the player and world objects be handled from the player class or as an event from the object classes?

Suppose you’re making a 3D platformer like Super Mario, if you jump on a Goomba, does Mario (the class) know that it just landed on a Goomba and then tell that Goomba to die, or does the Goomba realize that he is being smashed and dies ?

I want to go with the first approach but it will end up with a huge If/then (or Switch/Case) script, also the reason why this is “problematic” is that many objects will make the player have a “reaction”, for example if you land on a Goomba, you don’t just kill it, but it forces you to jump, that jump event, what’s the best way to handle it ?