network attached storage – How can I have a Synology NAS retrieve files from a remote SMB share then delete them?

I have a Synology NAS (with DSM 6.2.x), and have access to another machine that provides a SMB share. I need to have the NAS retrieve the content of a directory provided on the SMB share, then delete it. I have no control over the machine which provides the share (i.e. I must access it using SMB, and cannot have the machine push the files on the NAS.)

What would be the best way to have the NAS retrieve these files ?

Thank you in advance,

mysql – Stored procedure retrieve

Is their any possibilities to retrieve stored procedure condition which is applied for insertion after insert..? Mysql php.

You have to drop it and create it a new

Also php and mysqli don’t add DELIMITER to the CREATe PROCEDURE, so you have to do it yourself.

So the code must loook like

DROP PROCEDURE IF EXISTS Insertion;
DELIMITER $$
CREATE PROCEDURE Insertion(IN firstname varchar(40),IN lastname varchar(40),IN email varchar(40),IN department varchar(40),IN doj date,IN basicpay int(11))
BEGIN
  
  DECLARE HRA decimal(20,2);
  DECLARE DA decimal(20,2);
  DECLARE PF decimal(20,2);
  DECLARE NET_SALARY decimal(20,2);
  
  IF department = 'HUMAN RESOURCE' THEN
  SET HRA = (5/100)*basicpay;
  SET DA = (7/100)*basicpay;
  SET PF = (10/100)*basicpay;
  
  ELSEIF department = 'MARKETING' THEN
  SET HRA = (5/100)*basicpay;
  SET DA = (7/100)*basicpay;
  SET PF = (10/100)*basicpay;
  
  ELSEIF department = 'PRODUCTION' THEN
  SET HRA = (5/100)*basicpay;
  SET DA = (7/100)*basicpay;
  SET PF = (10/100)*basicpay;
  
  ELSEIF department = 'FINANCE AND ACCOUNTING' THEN
  SET HRA = (5/100)*basicpay;
  SET DA = (7/100)*basicpay;
  SET PF = (10/100)*basicpay;
  
  
  ELSE 
  SET HRA = (5/100)*basicpay;
  SET DA = (7/100)*basicpay;
  SET PF = (10/100)*basicpay;
  
  
  END IF; 
SET NET_SALARY = basicpay+HRA + DA + PF;
    
  insert into employees(FIRST_NAME,LAST_NAME,EMAIL,DEPARTMENT,DATE_OF_JOINING,BASIC_PAY,HRA,DA,PF,NET_SALARY)
  values(firstname,lastname,email,department,doj,basicpay,HRA,DA,PF,NET_SALARY);  
END$$
DELIMITER ;

Retrieve date ranges from multiple rows

I’m struggling to find an optimal way of achieving this without lots of individual queries and PHP, I’m sure there must be an easier way of doing it.

To simplify we have the following table structure:

CREATE TABLE `log` (
  id INT UNSIGNED AUTO_INCREMENT,
  userid INT,
  itemid INT,
  eventname VARCHAR(30),
  timecreated INT
);

timecreated is a unix timestamp, eventname will be one of 2 statuses (assigned or unassigned).

Assuming the following data (I’ve put actual dates so it’s easier to read):

id userid itemid action timecreated
1 1 1 assigned 2020-01-01
2 1 2 assigned 2020-01-01
3 1 1 unassigned 2020-03-01
4 1 1 assigned 2020-06-01
5 1 1 unassigned 2020-06-30

The output should be:

itemid start end
1 2020-01-01 2020-03-01
2 2020-01-01
1 2020-06-01 2020-06-30

How to retrieve sections of a form I accidently deleted (including the surveyors responses)?

First time using Google Forms and I was so impressed! It was doing everything I needed for research on a book I am writing. However, Thursday night… on my phone looking at some responses I accidentally deleted the questions (and the responses). I could not find them anywhere and re-created the document but I am now missing my first 40 responses. The updated survey still includes the #40 replies at the top but the answers are not there. Can it be recovered?

google drive – How to retrieve sections of a survey I accidently deleted (including the surveyors responses)?

First time using Google Surveys and I was so impressed! It was doing everything I needed for research on a book I am writing. However, Thursday night… on my phone looking at some responses I accidentally deleted the questions (and the responses). I could not find them anywhere and re-created the document but I am now missing my first 40 responses. The updated survey still includes the #40 replies at the top but the answers are not there. Can it be recovered? Please help!

firebase – Unable to retrieve data from firestore with flutter web app

I’m not able to retrieve data from cloud firestore using the flutter web app.
I can write data but cant read it.
In the app for android / ios it works fine with the emulator. I hope that someone can help me.

This is my index.html:

<!DOCTYPE html>
<html>
<head>
  <base href="/">

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">
  <meta name="description" content="A new Flutter project.">

  <!-- iOS meta tags & icons -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="hsgaburg">
  <link rel="apple-touch-icon" href="icons/Icon-192.png">

  <!-- Favicon -->
  <link rel="icon" type="image/png" href="favicon.png"/>

  <title>test</title>
  <link rel="manifest" href="manifest.json">
</head>
<body>
 
  <script>
    if ('serviceWorker' in navigator) {
      window.addEventListener('flutter-first-frame', function () {
        navigator.serviceWorker.register('flutter_service_worker.js');
      });
    }
  </script>
 <script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-app.js"></script> 

     <script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-analytics.js"></script>
     <script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-auth.js"></script>
     <script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-firestore.js"></script>
     <script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-functions.js"></script>
     <script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-messaging.js"></script>  
<script>
  var firebaseConfig = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: ""
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
</script>  


  <script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

With the StreamBuilder I want to retrieve the data:

 StreamBuilder<List<News>>(
      stream: newsBloc.getAllNews,
      builder: (context, snapshot) {
        if (!snapshot.hasData)
          return (UniversalPlatform.isIOS)
              ? CupertinoActivityIndicator()
              : CircularProgressIndicator();

        return Column(
          children: (
            Expanded(
              child: ListView.builder(
                itemCount: snapshot.data.length,
                itemBuilder: (context, index) {
                  return Container(
                    margin: EdgeInsets.all(10),
                    decoration: BoxDecoration(),
                    child: Bubble(
                      color: Colors.white,
                      elevation: 5,
                      margin: BubbleEdges.only(top: 10),
                      stick: true,
                      nip: BubbleNip.leftTop,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: (
                          Text(
                            snapshot.data(index).creator,
                            style: TextStyles.headline3,
                          ),
                          AppDivider(),
                          Padding(
                            padding:
                                const EdgeInsets.symmetric(vertical: 10.0),
                            child: Text(snapshot.data(index).newsText,
                                style: TextStyles.body),
                          ),
                          Row(
                            mainAxisAlignment: MainAxisAlignment.end,
                            children: (
                              Text(
                                formatDate(snapshot.data(index).createdAt),
                                style: TextStyles.placeholder,
                              ),
                            ),
                          ),
                        ),
                      ),
                    ),
                  );
                },
              ),
            ),
          ),
        );

        /* } else
                return CircularProgressIndicator(); */
      })

Here is my pubspec.yaml:

  flutter:
    sdk: flutter
  http:
  firebase_messaging: ^8.0.0-dev.11
  groovin_widgets: ^1.6.0
  provider: ^4.3.2+2
  shared_preferences: ^0.5.12+4
  firebase_core: ^0.7.0
  cloud_firestore: ^0.16.0
  firebase_auth: ^0.20.0+1
  device_info: ^1.0.0
  package_info: ^0.4.3+2
  uuid: ^2.2.2
  google_fonts: ^1.1.1
  rxdart: ^0.25.0
  bubble: ^1.1.9+1
  intl: ^0.16.1
  table_calendar: ^2.3.3
  flutter_bloc: ^6.1.1
  numberpicker: ^1.3.0
  ##for web:
  universal_platform: ^0.1.3