SQL Server Extended Events to Capture Objects access by a User

I am in for a requirement where I need to use EE to capture the Objects Accessed by a particular SQL User.

I want to avoid the action sqlserver.sql_text, if I use this, I will need to manually scan though the data which may be prone to missing some data or incorrect results.

Is there an alternative to using sqlserver.sql_text

Cannot add events to Google Calendar using Windows Calendar

I have been using Windows calendar to manage my Google Calendar for the last 2 years. And it was working flawlessly. Now when I try to add events to my calendar thru Windows calendar I am getting following error message:

“something went wrong and we were unable to save your recent edits “

and event is NOT added to Google. I tried everything: removed/added back account, uninstalled and installed the mail app but no results. it is so frustrating.

Does anybody have similar issues.

I always keep my laptop updated with all the Windows updates.

How can I configure Google Calendar so that it doesn’t automatically add calendar events from emails that were classified as spam?

How can I configure Google Calendar so that it doesn’t automatically add calendar events from emails (Gmail) that were classified as spam, while still automatically adding calendar events from non-spam emails?

Where to store (keep) websockets events?

I have an application that uses MySQL as the database.

When a user open a specific page, the app sends a websocket event to indicate all the other team members that this user is seeing the current page.

The issue is that if one of the team members refreshes their page, it will lose that event because the server do not store that user X is viewing the page.

For that, I store the view event on the database, and when loading the page, the site also returns who is viewing that page from the database.

But since this action can be a high input/output (many users opening/closing pages), is there a better way to do this, maybe storing on a NoSQL or some cache service like Redis?

Thank you

domain driven design – Primitive obsession, value objects, Commands, Events and where to convert

I tried to combine two rules.

  1. Don’t fall to primitive obsession (e.g. EMailAddress should be a value object in domain objects and not a string).
  2. Don’t use value objects in commands and events.

If commands and events should not contain value objects (for obvious and often discussed reason) they contain something as ” EMailAddress” as string.
In the aggregate it should be handled as an EMailAddress value object with it’s own constraints and checking.

So far, so good.

But where does the conversion happen?
Do we call a “void DoIt(string eMailAddress)” method on the aggregate root and one of its first actions is to convert the string into an EMail value object?
Or does the CommandHandler do the conversion and the aggregate root method looks like “void DoIt(EMailAddress eMailAddress)”?
Solution 2. seems more elegant, because it holds the aggregate root free of primitives and conversions.
But what about the events and even more interesting raising the event?

Example AggregateRoot Method with solution 2:

    public void ChangeEMailAddress(EMailAddress eMailAddress )
    {
         //Do some interesting stuff without changing state 
        ApplyChange(new  EMailAddressChanged(???));
    }

The ??? is the problem. If the event should not contain value objects the EMailAdress value object must be converted back into a string. Is a (second) constructor of the event (that takes the value object) allowed to do it, to keep the aggregate free of the conversion?

And what about the handling of the event in the aggregate root? In Simple CQRS Style it would be like this:

    private void Apply(EMailAddressChanged e)
    {
        this.eMailAddress = new EMailAddress(e.eMailAddress);
    }

So the conversion is again in the aggregate. We could also use EventHandlers here that do the conversion and then the method will look like:

    private void  EMailAddressChanged(EMailAddress eMailAddress)
    {
        this.eMailAddress =  eMailAddress ;
    }

(Yes I know thats simple CRUD stuff that maybe should not done the whole CQRS/ES way at all, assume that some logic is involved)

But there is one drawback here. In either solution, the conversion could fail. But an event should never fail. If I change the validation in the constructor of EMailAddress it is possible (if I use event sourcing) that older events can no longer be processed. So should I have 2 constructors/static create methods on my value objects? One with and one without validation?

So:

  1. Where do you do the conversion from primitive to value object and back in the 3 cases Handling of the Command, Raising of the Event, Handling of the event?
  2. How do you deal with value objects in event sourcing to ensure its constructor validation do not fail for older events?

I found Where to convert primitive types in meaningful types in Clean Architecture / Onion Architecture and it’s partly related, but does not answer my question.

unity – Is using events a good way to have the option to return out of a method or alter its normal execution?

Let’s say I have a script that calls a method frequently, and when doing so wants to allow other objects to know about it and potentially alter what happens in that method. This is fairly simple to do using C# events:

public class PassByReference 
{
    public bool foo;

    public PassByReference(bool foo)
    {
        this.foo = foo;
    }
}

public class Example : MonoBehaviour
{
    public event Action<PassByReference> OnSomethingHappened;

    private void DoSomething()
    {
        var returnOut = false;

        // Do some stuff

        var passByReference = new PassByReference(returnOut);
        OnSomethingHappened?.Invoke(passByReference); // Some other object can read and alter this

        if (passByReference.foo)
            return;

       // Do some more stuff
    }
}

Is this a good way to do things if one anticipates that, based on a combination of the information given by the event, and their own properties, other objects may want to stop the second half of the Example method from running (or maybe alter what happens)? I guess what I’m trying to do is prevent the Example class from having to store references to many other classes that will interact with it only occasionally, and clog up the method with many if statements. My main concern, though, is that frequently creating new classes to pass data via reference in the event(s) can lead to performance issues, especially if many objects in my game are using the Example script.

node.js – Multi regions events to be deduplicated and processed in a single region – How do I do this?

General overview

I am working on building a system that deals with an external resource which has been having issues and I am unable to switch away from it. It gives regional endpoints – this post is about handling the errors and taking actions and alerting without duplicate actions or alerts. Do note that this system is being designed to work with multiple external resources which have a serviceID to identify them.

Explaination of current state

Events are generated in multiple regions, they only happen on error cases however when an error occurs in one region it is likely that another region will have the same error on the external resource mentioned

What happens is say us-east-1 has an error and us-west-1 has one as well, both of these errors need to be processed by a single system which will take actions and alert if needed based on the error.

My current setup is pretty terrible in that it is region specific and if in the case above where there are issues in both us-east-1 and us-west-1 that the action needed will be taken twice same with the alert. This causes spam and also has a tendancy to break things in some edge cases I’ve experienced lately.

Goal

My goal is to have a system that when a single region has the issue the correct action and alert is done and when two or more regions have an issue that the action is only taken once and if needed a single alert goes out that lists the effected regions.

About the application and infrastructure

  • AWS based
  • Node.js micro services running in mix of EKS and Lambda
  • IaC via Terraform

Question

How can I design this system to handle the multi region events but have a single point where the actions and alerts are deduplicated and still retain their region for inclusion in the action (super important) and the alert?

My idea that hasn’t worked

Each region would generate the events when needed which would contain a serviceID like mentioned at the top of this post. Then on the primary region it would deduplicate the events using that service ID – I have zero clue how to do this, like using SQS queue or SNS or maybe my DB (MongoDB). Once the deduplication is done it would then send a SNS message in a fan out to 2 SQS queues which have Lambda’s attached to take either an action or alert based on the error message from the inital alert. This last part of Lamba working to do the action(s) and alerts needed is already done as it is part of the terrible existing mentioned.

Current issues with my idea

  • No deduplication working
  • Unable to get SQS/SNS messages to work across regions

I am open to any suggestions on how I could go about solving this problem of mine. Pretty much anything is possible from an approval standpoint.

How to control the multiple events based on function parameter in angular 8

I have 3 divs and having the click event, I am handling the click event using a function in each event.Now suppose I don’t want the click event for click3, that I need to control with parameter in function. I am not getting how to make it. Here is the code below https://stackblitz.com/edit/angular-9o3hgv?file=src%2Fapp%2Fapp.component.ts

app.component.html

<hello name="{{ name }}"></hello>
<p>
    Start editing to see some magic happen :)
</p>
<div (click)="click1()">Click1</div>
<div (click)="click2()">Click2</div>
<div (click)="click3()">Click3</div>

app.component.ts

import { Component } from "@angular/core";

@Component({
  selector: "my-app",
  templateUrl: "./app.component.html",
  styleUrls: ("./app.component.css")
})
export class AppComponent {
  name = "Angular";
  function1() {
    alert("hi");
  }
  click1() {
    this.function1();
  }
  click2() {
    this.function1();
  }
  click3() {
    this.function1();
  }
}

unity – OnMouse Events stop working when multiple cameras are active

I’m working on 2019.4.9f1 on a 2D project using Universal Rendering Pipeline. The camera settings changed so I’m stating it.

I wrote a OnMouseEnter and OnMouseExit in a script to manage whenever my mouse cursor is on top of a SpriteRenderer with a collider located at 0,0,0. I have a main camera located at 0,0,-10. I’ve tested the script that manages the OnMouse events. It works fine.

Problem: But the moment I add a new camera (UI Camera set to Overlay located at 0,0,-10) in and it is enabled, OnMouse events aren’t getting called. Disabling the UI camera makes the OnMouse events work normally.

Solutions that have failed:

  1. I’ve tried setting the tag of the UI Camera to MainCamera and set
    Main Camera’s tag to Default.
    https://answers.unity.com/questions/241334/onmousedown-w-multiple-cameras-doesnt-work-right.html
  2. I tried making the UI Camera a bit closer to the sprites.
    https://answers.unity.com/questions/425478/onmousedown-not-firing.html

I intend to avoid Raycasting and get the OnMouse Events to work because I want to fix the problem and not work around it.

Question: Any possible reason why my OnMouse events aren’t called?

Is there a way to display calendar events like the attached (looking for this type of look and feel)

Is there a way to display calendar events like the attached (looking for this type of look and feel)

enter image description here