How can I identify apps that trigger events in MacroDroid

MacroDroid can be triggered for a broad set of events. In particular it can detect and log when GPS location is enabled or disabled. This is useful but I would like to understand which app made the request.

I would like to find a way to identify the app that made the request associated with the event i.e. which app is requesting GPS location be turned on. Does MacroDroid have the capability to identify the app triggering the event? Alternatively if this is not possible could MacroDroid capture the app that were running at the time GPS location was enabled?

For completeness phone is a Galaxy Note 8 (SM-N950F) running Android 8.0.0

postgresql – Postgres, trigger function, is it bad for performance?

I have added the following trigger function to one of my tables in my Postgres database.

CREATE OR REPLACE FUNCTION trigger_set_timestamp()
RETURNS TRIGGER AS $$
BEGIN
  NEW.updated_at = NOW();
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

I am new to this, so, I am wondering, is this going to slow down my database? Should I avoid trigger functions for performance reasons and if so, what’s the alternative?

(In this case this is the only way I knew how to make the updated_at date column always set the date when any of the columns in the table would change….)

mysql – TRIGGER CON CONDICION

tengo un código donde intento hacer un insert a una tabla dependiendo del caso, para esto utilizo un triggers, todo estoy en MYSQL… necesito ayuda en la manera de elaborar el triggers ya que al ejecutar me sale error de sintaxis

acá el código:

CREATE TRIGGER insert_role after insert on users
for EACH ROW
BEGIN
if new.tipo_usuario = ‘ADMINISTRADOR’ then
insert into model_has_roles(role_id,model_type,model_id) values (1,concat_ws(CHAR(92),’App’,’User’),new.id);
end IF
if NEW.tipo_usuario = ‘EMPLEADO’ then
insert into model_has_roles(role_id,model_type,model_id) values (2,concat_ws(CHAR(92),’App’,’User’),new.id);
end IF
if NEW.tipo_usuario =’CLIENTE’ then
insert into model_has_roles(role_id,model_type,model_id) values (3,concat_ws(CHAR(92),’App’,’User’),new.id);
end IF
END;

powershell – Zabbix trigger for finding difference in the previous and current item output

I have got an item, which executes some powershell script on remote machine, it returns string. I want to set zabbix trigger, to activate if current and previous output of script are different. I have tried something like this:

{MyTemplate:MyItem.diff()=1}

and also:

{MyItem.change(0)}#0

None of them seem to be working. Any ideas how to solve it?

notifications – What’s the best way to trigger an android app to run a function based on a request sent by the server?

Here is the use case:

  • the user launches the app and grants permission, the app connects to the server
  • at some point in the future, the server sends a request to the app
  • the app, regardless of whether it is running or not in the foreground or background, wakes up to run this code

Here are some options I have explored which I am unsure about:

  • server sent events
  • websockets
  • push notifications

Is there a reliable and safe way to do this on android, whether it’s Kotlin or Flutter? Can you provide examples or documentation?

Thanks!

custom list – I want to create a Flow that will trigger an email alert

I have a custom list that I need to create a Power Automate trigger to send an email alert similar the the “Alert me” option. Alert me

I want the alert to be sent to the assigned part whenever a new item is created or an existing item is modified. I have that part figured out but it is the alert that I am having trouble with. I can get an email to send a custom notification email but what I want it to send is below. Any ideas?

email

sharepoint online – trigger Approval Worflow Action using powerapps button –PowerAutomate

I created a simple Approval Workflow in PowerAutomate. When that workflow is triggered Assigned to user gets an email with two workflow action: Approve and Reject. When i click on Approve workflow proceeds to next step.

Then i created a Approve Button on PowerApp gallery. Now what i want to do it when i click on Approve button, it will do same what above Approve Button does. It should GO to next step in workflow.

Is that possible to achieve.

How do you combine multiple update statements for the same row using MySQL trigger

Background:

Each time a column is modified, I need to update the associated column (which has the same name) in a second table. This is my first attempt at using a trigger.

Code:

Here’s a simplified example of what I’m trying to do, which does its job fine, but inefficiently:

DROP TRIGGER IF EXISTS update_second_table;
DELIMITER //
CREATE TRIGGER update_second_table
  BEFORE UPDATE ON first_table 
  FOR EACH ROW
BEGIN
  /* putting IF statements on one line so it's easier to see what's happening */
  IF NOT(OLD.firstname <=> NEW.firstname)   THEN UPDATE second_table SET firstname  = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.middlename <=> NEW.middlename) THEN UPDATE second_table SET middlename = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.lastname <=> NEW.lastname)     THEN UPDATE second_table SET lastname   = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.nickname <=> NEW.nickname)     THEN UPDATE second_table SET nickname   = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.dob <=> NEW.dob)               THEN UPDATE second_table SET dob        = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.email <=> NEW.email)           THEN UPDATE second_table SET email      = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.address <=> NEW.address)       THEN UPDATE second_table SET address    = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.city <=> NEW.city)             THEN UPDATE second_table SET city       = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.state <=> NEW.state)           THEN UPDATE second_table SET state      = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.zip <=> NEW.zip)               THEN UPDATE second_table SET zip        = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
  IF NOT(OLD.phone <=> NEW.phone)           THEN UPDATE second_table SET phone      = CURRENT_TIMESTAMP WHERE id = OLD.id; END IF;
END;
//
DELIMITER;

The problem:

As you can see, depending on how many columns are updated in `first_table`, there can be as many as 11 update statements on the same row in `second_table`.

The question:

Is there any way to combine the update statements into one?

shutter – What DIY methods exist to trigger a Lumix G3 without touching the camera?

I have a Panasconic Lumix DMC-G3 with a 175 mm lens which I need to trigger without touching the camera to reduce camera shake1.

I know of the following ways to take a photo without touching the camera, however at the moment I cannot use any of those:

  1. Cable release: A device that you plug into your camera with a button that releases the camera shutter.
    • I don’t own a cable release for this camera.
  2. Intervalometer: A cable releases with the possibility to set up timers, e.g. for timelapses.
    • I don’t own an intervalometer for this camera.
  3. Remote Release: Similar to cable releases, but they are not plugged into the camera and work via infrared.
    • I don’t own a remote release for this camera.
  4. Smartphone App: Many (modern) cameras have built-in WiFi or Bluetooth which allows you to take a photo and sometimes even change settings using a smartphone app.
    • This camera has no WiFi or Bluetooth
  5. PC software: Some cameras can be tethered to a PC (usually using a cable) and can be controlled and fired with some software.
  6. Camera self-timer: Most cameras have a self-timer (e.g. 2 or 10 seconds).
    • I experienced that this can still cause camera shake when using a telephoto lens, about 3/4 of the images were shaky taken this way1.

Are there any DIY methods than those described above to take a photo without touching the camera?


1: My other question contains more information on the problem at hand: I’m trying to photograph comet C/2020 F3 (Neowise) by stacking images, but the results are too shaky.

c++ – Dynamic Memory Allocation relieving Trigger Issue

When I tried to relieve 2 dynamic memory allocations at the end of the code, Trigger issue had been popped up. I assume that I set unspecific array so it’s likely that compiler define the size of memory to be relieved bigger.

how can I correctly modify these 2 lines delete() msgs; and delete() imageFile; ?
Here’s the code

#include <iostream>
#include <string>

using namespace std;

class Image {
public:
    operator string() {
        return "사진";
    }
};

class Msg {
public:
    Msg(int sendTime, string sendName) {
        this->sendTime = sendTime;
        this->sendName = sendName;
    }
    int GetSendTime() const { return sendTime; }
    string GetSendName() const { return sendName; }
    virtual string GetContent() const { return""; } 

protected:
    int sendTime;
    string sendName;
};

class Text_Msg : public Msg {
public:
    Text_Msg(int sendTime, string sendName, string text) : Msg(sendTime, sendName) {
        this->text = text;
    }
    string GetContent() const { return text; }

private:
    string text;
};

class Image_Msg : public Msg {
public:
    Image_Msg(int sendTime, string sendName, Image* image) :Msg(sendTime, sendName) {
        this->image = image;
    }
    string GetContent() const { return (string)*image; } 
private:
    Image *image;
};

void printMsg(Msg &m) { 
    cout << "(" << m.GetSendTime() / 100 << ":" << m.GetSendTime() % 100 << ") "; 
    cout << m.GetSendName() << " - "; 
    cout << m.GetContent() << endl;  
}

int main() {

    Image* imageFile() = {
        new Image(),
        new Image(),
        new Image()
    };
    Msg* msgs() = { 
    new Text_Msg(1230, "성훈", "안녕, 우리 강아지 사진 보내줄게 !"),
    new Image_Msg(1231, "성훈", imageFile(0)),
    new Image_Msg(1231, "성훈", imageFile(1)),
    new Image_Msg(1231, "성훈", imageFile(2)),
    new Text_Msg(1232, "민주", "와 진짜 귀엽다!"),
    new Text_Msg(1235, "성훈", "그치! 담에 놀러와~~"),
    new Text_Msg(1237, "민주", "응 안녕~!")
    };

    for (Msg* m : msgs) {
        printMsg(*m);
    };


    delete() msgs; //Fail Here!
    delete() imageFile;  //Fail Here! (Trigger Issue occured)
}