问:
Syntax for excluding deprecated directories with Maven
I have a few directories in my Java project that hold deprecated code: com.company.deprecated and com.partner.company.deprecated. I want to exclude everything in these two "deprecated" directories from Maven compilation, regardless of content or directory structure inside them, so I have created a build tag like this at the very end of my POM:

```<code>    <!-- Exclude directories that hold deprecated code -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/com/company/deprecated</exclude>
                        <exclude>**/com/partner/company/deprecated</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</code>```

This POM handles a module inside a larger project, but the deprecated code isn't used anywhere else inside other modules, so I don't think there are any conflict issues going on with other POMs. I have tried putting the "build" element at the end of either the specific module POM or the project POM, and get the same compilation errors each time.

As far as I can tell, this should exclude the deprecated directories from my Maven build, but I keep getting compilation errors in files within the "deprecated" directories. I have tried the double asterisk syntax above, absolute paths, and wildcards after "deprecated" but nothing seems to work. I've gone through StackOverflow and haven't found anything exactly like what I'm trying to do, although I am still relatively new to Maven so it is very possible there is something I'm just being dense about.

Can anyone please help me with the proper syntax (or perhaps a different plugin?) for this issue? Thank you!

Body:
I have a few directories in my Java project that hold deprecated code: com.company.deprecated and com.partner.company.deprecated. I want to exclude everything in these two "deprecated" directories from Maven compilation, regardless of content or directory structure inside them, so I have created a build tag like this at the very end of my POM:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/com/company/deprecated</exclude>
                        <exclude>**/com/partner/company/deprecated</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

This POM handles a module inside a larger project, but the deprecated code isn't used anywhere else inside other modules, so I don't think there are any conflict issues going on with other POMs. I have tried putting the "build" element at the end of either the specific module POM or the project POM, and get the same compilation errors each time.

As far as I can tell, this should exclude the deprecated directories from my Maven build, but I keep getting compilation errors in files within the "deprecated" directories. I have tried the double asterisk syntax above, absolute paths, and wildcards after "deprecated" but nothing seems to work. I've gone through StackOverflow and haven't found anything exactly like what I'm trying to do, although I am still relatively new to Maven so it is very possible there is something I'm just being dense about.

Can anyone please help me with the proper syntax (or perhaps a different plugin?) for this issue? Thank you!


来源: stackexchange

问:
Navigation bar is not hiding in HostingViewController for iOS 16 if you build the app using Xcode 13.4.1
I am using xcode 13.4.1 for build apps and also Hostingviewcontroller to host SwiftUI views. If I deploy the app in iOS 16, navigation bar is not hiding properly.</p>
```<code>class HomeViewController: UIHostingController<HomeView> {

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    navigationController?.setNavigationBarHidden(true, animated: false)

}
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am using xcode 13.4.1 for build apps and also Hostingviewcontroller to host SwiftUI views. If I deploy the app in iOS 16, navigation bar is not hiding properly.

class HomeViewController: UIHostingController<HomeView> {

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    navigationController?.setNavigationBarHidden(true, animated: false)

}
}


问:
How do i clear the stdcout, or cancel a pipe in c?
i have a parser that generates c code and prints it using printf and i want to pipe it like this:

```<code>./program | gcc -xc -
</code>```

The problem is that if i encounter an error i need to pipe nothing to gcc.

Is there a better solution then parsing once to scan for errors and then parsing to print the output to stdout?

Body:
i have a parser that generates c code and prints it using printf and i want to pipe it like this:

./program | gcc -xc -

The problem is that if i encounter an error i need to pipe nothing to gcc.

Is there a better solution then parsing once to scan for errors and then parsing to print the output to stdout?


问:
chrome.runtime.onMessage sendResponse async not working in Safari extension
My background script is listening for a message from the content script, it then needs to do some async work (setting/retrieving some keys in local storage).

```<code>  chrome.runtime.onMessage.addListener(function (
    message,
    sender,
    sendResponse
  ) {
    doAsyncStuff()
     .then(() => {
       sendResponse('response');
     })

    return true;
  });
}
</code>```

So I am returning true, which should let me call sendResponse when the promise resolves.  But this is not working.  My content script is not getting the response, even though the promise does resolve.

If remove the async and just sendResponse it works fine and the content script gets the response

```<code>  chrome.runtime.onMessage.addListener(function (
    message,
    sender,
    sendResponse
  ) {
    sendResponse('response');
    return true;
  });
}
</code>```

This extension was originally written as a chrome extension and the async sendResponse works fine in that, its just in the safari extension it isn't working.  I'm using xcrun safari-web-extension-converter to convert the chrome extension into a safari extension.

The docs  don't make any reference to this not working in Safari that I can see, so I am at a loss as to why this isn't working.  My safari version is 16.1

Body:
My background script is listening for a message from the content script, it then needs to do some async work (setting/retrieving some keys in local storage).

  chrome.runtime.onMessage.addListener(function (
    message,
    sender,
    sendResponse
  ) {
    doAsyncStuff()
     .then(() => {
       sendResponse('response');
     })

    return true;
  });
}

So I am returning true, which should let me call sendResponse when the promise resolves.  But this is not working.  My content script is not getting the response, even though the promise does resolve.

If remove the async and just sendResponse it works fine and the content script gets the response

  chrome.runtime.onMessage.addListener(function (
    message,
    sender,
    sendResponse
  ) {
    sendResponse('response');
    return true;
  });
}

This extension was originally written as a chrome extension and the async sendResponse works fine in that, its just in the safari extension it isn't working.  I'm using xcrun safari-web-extension-converter to convert the chrome extension into a safari extension.

The docs  don't make any reference to this not working in Safari that I can see, so I am at a loss as to why this isn't working.  My safari version is 16.1


问:
cheerypy server is timing out
I am running a CherryPy Local server. But After sometime server is timing out. I am new to CherryPy server and I found in error.log this message and unable to solve this issue.

CherryPy==18.8.0
Cherrot==8.6.0
Python==3.8.1

```<code>Traceback (most recent call last):
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\server.py", line 1300, in communicate
    req.respond()
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\server.py", line 1090, in respond
    self.server.gateway(self).respond()
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\wsgi.py", line 145, in respond
    self.write(chunk)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\wsgi.py", line 231, in write
    self.req.write(chunk)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\server.py", line 1146, in write
    self.conn.wfile.write(chunk)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\makefile.py", line 438, in write
    res = super().write(val, *args, **kwargs)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\makefile.py", line 36, in write
    self._flush_unlocked()
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\makefile.py", line 45, in _flush_unlocked
    n = self.raw.write(bytes(self._write_buf))
  File "c:\python381\lib\socket.py", line 687, in write
    return self._sock.send(b)
  File "c:\python381\lib\ssl.py", line 1173, in send
    return self._sslobj.write(data)
socket.timeout: The write operation timed out
</code>```

Title: cheerypy server is timing out

Body:
I am running a CherryPy Local server. But After sometime server is timing out. I am new to CherryPy server and I found in error.log this message and unable to solve this issue.

CherryPy==18.8.0
Cherrot==8.6.0
Python==3.8.1

Traceback (most recent call last):
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\server.py", line 1300, in communicate
    req.respond()
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\server.py", line 1090, in respond
    self.server.gateway(self).respond()
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\wsgi.py", line 145, in respond
    self.write(chunk)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\wsgi.py", line 231, in write
    self.req.write(chunk)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\server.py", line 1146, in write
    self.conn.wfile.write(chunk)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\makefile.py", line 438, in write
    res = super().write(val, *args, **kwargs)
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\makefile.py", line 36, in write
    self._flush_unlocked()
  File "C:\Users\test\Envs\eps\lib\site-packages\cheroot\makefile.py", line 45, in _flush_unlocked
    n = self.raw.write(bytes(self._write_buf))
  File "c:\python381\lib\socket.py", line 687, in write
    return self._sock.send(b)
  File "c:\python381\lib\ssl.py", line 1173, in send
    return self._sslobj.write(data)
socket.timeout: The write operation timed out


问:
HAProxy creates thousands of connections with itself
I'm not an expert in HAProxy. What I see is over time haproxy seems to accumulate (tens of)thousands of TCP sessions, and the source seems to be the same as the server...?

Why is it creating sessions with ports other than 8123 it's bound to?

```<code> frontend tcp_front
   bind *:8123
   mode tcp
   default_backend host_sub5

backend host_sub5
  mode tcp
  server node2 0.0.0.0:8123 check
</code>```

show sess - this is a tiny fraction but the ports seem to grow sequentially like it's a netscan

```<code>haproxy   772263         haproxy *263u  IPv4 626477013      0t0  TCP 127.215.21.22:38423->127.215.21.22:8123 (ESTABLISHED)
haproxy   772263         haproxy *264u  IPv4 626477014      0t0  TCP 127.215.21.22:8123->127.215.21.22:38423 (ESTABLISHED)
haproxy   772263         haproxy *265u  IPv4 626477016      0t0  TCP 127.215.21.22:38435->127.215.21.22:8123 (ESTABLISHED)
haproxy   772263         haproxy *266u  IPv4 626477035      0t0  TCP 127.215.21.22:8123->127.215.21.22:38435 (ESTABLISHED)
haproxy   772263         haproxy *267u  IPv4 626477037      0t0  TCP 127.215.21.22:38437->127.215.21.22:8123 (ESTABLISHED)
haproxy   772263         haproxy *268u  IPv4 626477041      0t0  TCP 127.215.21.22:8123->127.215.21.22:38437 (ESTABLISHED)
</code>```

Body:
I'm not an expert in HAProxy. What I see is over time haproxy seems to accumulate (tens of)thousands of TCP sessions, and the source seems to be the same as the server...?

Why is it creating sessions with ports other than 8123 it's bound to?

 frontend tcp_front
   bind *:8123
   mode tcp
   default_backend host_sub5

backend host_sub5
  mode tcp
  server node2 0.0.0.0:8123 check

show sess - this is a tiny fraction but the ports seem to grow sequentially like it's a netscan

haproxy   772263         haproxy *263u  IPv4 626477013      0t0  TCP 127.215.21.22:38423->127.215.21.22:8123 (ESTABLISHED)
haproxy   772263         haproxy *264u  IPv4 626477014      0t0  TCP 127.215.21.22:8123->127.215.21.22:38423 (ESTABLISHED)
haproxy   772263         haproxy *265u  IPv4 626477016      0t0  TCP 127.215.21.22:38435->127.215.21.22:8123 (ESTABLISHED)
haproxy   772263         haproxy *266u  IPv4 626477035      0t0  TCP 127.215.21.22:8123->127.215.21.22:38435 (ESTABLISHED)
haproxy   772263         haproxy *267u  IPv4 626477037      0t0  TCP 127.215.21.22:38437->127.215.21.22:8123 (ESTABLISHED)
haproxy   772263         haproxy *268u  IPv4 626477041      0t0  TCP 127.215.21.22:8123->127.215.21.22:38437 (ESTABLISHED)


问:
Cant get field to show in the aggregation framework
I have db of the kind below</p>
```<code>{
  "_id": {
    "$oid": "5fd0bbae2fc35ebd500d91c6"
  },
  "movie_id": "0055657",
  "title": "The Alfred Hitchcock Hour",
  "year": "1962",
  "length": 50,
  "crew": [
    {
      "person_id": "0381638",
      "give_name": "Gordon Hessler",
      "birth_date": {
        "$date": {
          "$numberLong": "-1390262400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1390089600000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0516093",
      "give_name": "Norman Lloyd",
      "birth_date": {
        "$date": {
          "$numberLong": "-1740355200000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0365661",
      "give_name": "Joan Harrison",
      "birth_date": {
        "$date": {
          "$numberLong": "-1972944000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "776822400000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0171050",
      "give_name": "Herbert Coleman",
      "birth_date": {
        "$date": {
          "$numberLong": "-1958342400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1002067200000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0001888",
      "give_name": "Robert Douglas",
      "birth_date": {
        "$date": {
          "$numberLong": "-1898035200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "916012800000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0751063",
      "give_name": "Charles Russell",
      "role": "producer"
    },
    {
      "person_id": "0277643",
      "give_name": "Morton S. Fine",
      "birth_date": {
        "$date": {
          "$numberLong": "-1673222400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "668304000000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0295053",
      "give_name": "David Friedkin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1824595200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "214185600000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0723629",
      "give_name": "David Lowell Rich",
      "birth_date": {
        "$date": {
          "$numberLong": "-1556928000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1003622400000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0458033",
      "give_name": "Alf Kjellin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1572912000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "576201600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0628149",
      "give_name": "Joseph M. Newman",
      "birth_date": {
        "$date": {
          "$numberLong": "-1906156800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1137974400000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0320637",
      "give_name": "Bernard Girard",
      "birth_date": {
        "$date": {
          "$numberLong": "-1636502400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "883440000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0103975",
      "give_name": "John Brahm",
      "birth_date": {
        "$date": {
          "$numberLong": "-2410128000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "403228800000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0678928",
      "give_name": "Joseph Pevney",
      "birth_date": {
        "$date": {
          "$numberLong": "-1839715200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1211068800000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0366314",
      "give_name": "Harvey Hart",
      "birth_date": {
        "$date": {
          "$numberLong": "-1304553600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "627609600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0828720",
      "give_name": "Robert Stevens",
      "birth_date": {
        "$date": {
          "$numberLong": "-1548892800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "618451200000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0001888",
      "give_name": "Robert Douglas",
      "birth_date": {
        "$date": {
          "$numberLong": "-1898035200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "916012800000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0806915",
      "give_name": "Jack Smight",
      "birth_date": {
        "$date": {
          "$numberLong": "-1414281600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1062374400000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0295053",
      "give_name": "David Friedkin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1824595200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "214185600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0516093",
      "give_name": "Norman Lloyd",
      "birth_date": {
        "$date": {
          "$numberLong": "-1740355200000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0189075",
      "give_name": "Alan Crosland Jr.",
      "birth_date": {
        "$date": {
          "$numberLong": "-1623801600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1008633600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0202297",
      "give_name": "Herschel Daugherty",
      "birth_date": {
        "$date": {
          "$numberLong": "-1867622400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "731289600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0001628",
      "give_name": "Sydney Pollack",
      "birth_date": {
        "$date": {
          "$numberLong": "-1120435200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1211760000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0723629",
      "give_name": "David Lowell Rich",
      "birth_date": {
        "$date": {
          "$numberLong": "-1556928000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1003622400000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0070670",
      "give_name": "Laslo Benedek",
      "birth_date": {
        "$date": {
          "$numberLong": "-2045779200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "700272000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0604702",
      "give_name": "Harry Morgan",
      "birth_date": {
        "$date": {
          "$numberLong": "-1727136000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1323216000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0108745",
      "give_name": "James Bridges",
      "birth_date": {
        "$date": {
          "$numberLong": "-1070150400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "739324800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0805748",
      "give_name": "Henry Slesar",
      "birth_date": {
        "$date": {
          "$numberLong": "-1343001600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1017705600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0743232",
      "give_name": "Arthur A. Ross",
      "birth_date": {
        "$date": {
          "$numberLong": "-1574985600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1226361600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0088645",
      "give_name": "Robert Bloch",
      "birth_date": {
        "$date": {
          "$numberLong": "-1664409600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "780278400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0370883",
      "give_name": "Alfred Hayes",
      "birth_date": {
        "$date": {
          "$numberLong": "-1852675200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "492825600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0330664",
      "give_name": "William D. Gordon",
      "birth_date": {
        "$date": {
          "$numberLong": "-1640736000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "681955200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0506087",
      "give_name": "Richard Levinson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1117238400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "542505600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0512894",
      "give_name": "William Link",
      "birth_date": {
        "$date": {
          "$numberLong": "-1137542400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0277643",
      "give_name": "Morton S. Fine",
      "birth_date": {
        "$date": {
          "$numberLong": "-1673222400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "668304000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0295053",
      "give_name": "David Friedkin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1824595200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "214185600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0613732",
      "give_name": "Joel Murcott",
      "birth_date": {
        "$date": {
          "$numberLong": "-1728259200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "256435200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0203405",
      "give_name": "Lewis Davidson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1363305600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "645580800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0528530",
      "give_name": "Barré Lyndon",
      "birth_date": {
        "$date": {
          "$numberLong": "-2315865600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "88646400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0275848",
      "give_name": "Richard Fielder",
      "role": "writer"
    },
    {
      "person_id": "0375355",
      "give_name": "Lukas Heller",
      "birth_date": {
        "$date": {
          "$numberLong": "-1244937600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "594432000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0558577",
      "give_name": "Richard Matheson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1384214400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1371945600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709351",
      "give_name": "Lou Rambeau",
      "role": "writer"
    },
    {
      "person_id": "0082941",
      "give_name": "John Bingham",
      "birth_date": {
        "$date": {
          "$numberLong": "-1930089600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "586828800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0062629",
      "give_name": "Paul Winterton",
      "birth_date": {
        "$date": {
          "$numberLong": "-1952985600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "978912000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0269623",
      "give_name": "William Fay",
      "birth_date": {
        "$date": {
          "$numberLong": "-1637020800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "347155200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1664770",
      "give_name": "Robert Arthur",
      "birth_date": {
        "$date": {
          "$numberLong": "-1897948800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-21081600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0102824",
      "give_name": "Leigh Brackett",
      "birth_date": {
        "$date": {
          "$numberLong": "-1706313600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "258940800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0437320",
      "give_name": "Henry Kane",
      "role": "writer"
    },
    {
      "person_id": "1707646",
      "give_name": "Andrew Benedict",
      "role": "writer"
    },
    {
      "person_id": "0344181",
      "give_name": "Davis Grubb",
      "birth_date": {
        "$date": {
          "$numberLong": "-1591920000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "333244800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0587743",
      "give_name": "Oscar Millard",
      "birth_date": {
        "$date": {
          "$numberLong": "-1951430400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "660528000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0001969",
      "give_name": "Ray Bradbury",
      "birth_date": {
        "$date": {
          "$numberLong": "-1557705600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1338854400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0728567",
      "give_name": "Jack Ritchie",
      "birth_date": {
        "$date": {
          "$numberLong": "-1509926400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "419904000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709246",
      "give_name": "Stanley Abbott",
      "role": "writer"
    },
    {
      "person_id": "0855704",
      "give_name": "Anthony Terpiloff",
      "birth_date": {
        "$date": {
          "$numberLong": "-1288224000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "254793600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0306664",
      "give_name": "John Garden",
      "role": "writer"
    },
    {
      "person_id": "0308177",
      "give_name": "Oliver H.P. Garrett",
      "birth_date": {
        "$date": {
          "$numberLong": "-2387491200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-563587200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0531792",
      "give_name": "John D. MacDonald",
      "birth_date": {
        "$date": {
          "$numberLong": "-1686441600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "536112000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0698115",
      "give_name": "V.S. Pritchett",
      "birth_date": {
        "$date": {
          "$numberLong": "-2178835200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "858816000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709355",
      "give_name": "Samuel Rogers",
      "role": "writer"
    },
    {
      "person_id": "1713448",
      "give_name": "Charles Runyon",
      "role": "writer"
    },
    {
      "person_id": "0941280",
      "give_name": "Cornell Woolrich",
      "birth_date": {
        "$date": {
          "$numberLong": "-2085264000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-40003200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0068666",
      "give_name": "George Bellak",
      "birth_date": {
        "$date": {
          "$numberLong": "-1600992000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1035244800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0086671",
      "give_name": "Nicholas Blake",
      "birth_date": {
        "$date": {
          "$numberLong": "-2072736000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "75340800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1707649",
      "give_name": "Amber Dean",
      "birth_date": {
        "$date": {
          "$numberLong": "-2116108800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "486604800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0225779",
      "give_name": "Francis Didelot",
      "role": "writer"
    },
    {
      "person_id": "0260012",
      "give_name": "Lee Erwin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1997740800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "66441600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0294016",
      "give_name": "Celia Fremlin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1752537600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1245110400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1113277",
      "give_name": "Robert Gould",
      "role": "writer"
    },
    {
      "person_id": "0375925",
      "give_name": "Elizabeth Hely",
      "role": "writer"
    },
    {
      "person_id": "0452134",
      "give_name": "Roland Kibbee",
      "birth_date": {
        "$date": {
          "$numberLong": "-1763337600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "460512000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1707657",
      "give_name": "Hilda Lawrence",
      "role": "writer"
    },
    {
      "person_id": "0523269",
      "give_name": "Marie Belloc Lowndes",
      "birth_date": {
        "$date": {
          "$numberLong": "-3200083200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-698457600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0748111",
      "give_name": "Mann Rubin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1327276800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1381536000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0843387",
      "give_name": "Julian Symons",
      "birth_date": {
        "$date": {
          "$numberLong": "-1817424000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "785203200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709380",
      "give_name": "Robert Twohy",
      "role": "writer"
    },
    {
      "person_id": "0912451",
      "give_name": "Douglas Warner",
      "role": "writer"
    },
    {
      "person_id": "1713404",
      "give_name": "Robert Branson",
      "role": "writer"
    },
    {
      "person_id": "1709265",
      "give_name": "Thomas H. Cannan Jr.",
      "birth_date": {
        "$date": {
          "$numberLong": "-1129161600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "722995200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0269879",
      "give_name": "Kenneth Fearing",
      "birth_date": {
        "$date": {
          "$numberLong": "-2127945600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-268790400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1088301",
      "give_name": "C.B. Gilford",
      "birth_date": {
        "$date": {
          "$numberLong": "-1550793600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1280188800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0393512",
      "give_name": "Randall Hood",
      "birth_date": {
        "$date": {
          "$numberLong": "-1306627200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "209001600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709303",
      "give_name": "S.B. Hough",
      "role": "writer"
    },
    {
      "person_id": "1493117",
      "give_name": "Veronica Parker Johns",
      "role": "writer"
    },
    {
      "person_id": "1707659",
      "give_name": "Margaret Manners",
      "role": "writer"
    },
    {
      "person_id": "0549924",
      "give_name": "Max Marquis",
      "role": "writer"
    },
    {
      "person_id": "1622374",
      "give_name": "Margaret Millar",
      "birth_date": {
        "$date": {
          "$numberLong": "-1732665600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "764640000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709337",
      "give_name": "Emily Neff",
      "role": "writer"
    },
    {
      "person_id": "1709357",
      "give_name": "Sidney Rowland",
      "role": "writer"
    },
    {
      "person_id": "0811772",
      "give_name": "Boris Sobelman",
      "birth_date": {
        "$date": {
          "$numberLong": "-1902873600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "33955200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0881501",
      "give_name": "Gabrielle Upton",
      "role": "writer"
    },
    {
      "person_id": "0920229",
      "give_name": "H.G. Wells",
      "birth_date": {
        "$date": {
          "$numberLong": "-3259180800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-738028800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0923839",
      "give_name": "Hugh Wheeler",
      "birth_date": {
        "$date": {
          "$numberLong": "-1823644800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "554256000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0943909",
      "give_name": "John Wyndham",
      "birth_date": {
        "$date": {
          "$numberLong": "-2097964800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-25574400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1093689",
      "give_name": "Avram Davidson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1473552000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "736819200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1707308",
      "give_name": "Richard Deming",
      "birth_date": {
        "$date": {
          "$numberLong": "-1725840000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "431568000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709281",
      "give_name": "Nigel Elliston",
      "role": "writer"
    },
    {
      "person_id": "1709300",
      "give_name": "Larry M. Harris",
      "role": "writer"
    },
    {
      "person_id": "1713422",
      "give_name": "James Holding",
      "role": "writer"
    },
    {
      "person_id": "0397208",
      "give_name": "Clark Howard",
      "role": "writer"
    },
    {
      "person_id": "0414669",
      "give_name": "W.W. Jacobs",
      "birth_date": {
        "$date": {
          "$numberLong": "-3354998400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-831081600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0421862",
      "give_name": "Selwyn Jepson",
      "role": "writer"
    },
    {
      "person_id": "0561260",
      "give_name": "André Maurois",
      "birth_date": {
        "$date": {
          "$numberLong": "-2664489600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-70588800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0624776",
      "give_name": "Helen Nielsen",
      "birth_date": {
        "$date": {
          "$numberLong": "-1615507200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1024704000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0924781",
      "give_name": "Ethel Lina White",
      "role": "writer"
    },
    {
      "person_id": "0996167",
      "give_name": "James Yaffe",
      "birth_date": {
        "$date": {
          "$numberLong": "-1349308800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1496534400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0000033",
      "give_name": "Alfred Hitchcock",
      "birth_date": {
        "$date": {
          "$numberLong": "-2221171200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "325814400000"
        }
      },
      "role": "actor",
      "character": "Alfred Hitchcock - Host"
    }
  ],
  "ratings": [
    {
      "source": "IMDb",
      "rating_date": {
        "$date": {
          "$numberLong": "1509408000000"
        }
      },
      "score": 8.6
    }
  ]
}
</code>```
<p>I want to query the crew that is still alive, hence where crew.death_date is missing, and then sort them by birth date.
I achieved it this way as it was very simple</p>
```<code>db.movie.aggregate([
    {"$unwind": "$crew"},
    {"$match": {"crew.death_date": {"$exists": false}}},
    {"$project": {"crew.give_name": 1, "crew.birth_date": 1}},
    {"$sort": {"crew.birth_date": 1}},
])
</code>```
<p>However the result is comprised only of the "crew.give_name" and not of the birth date despite i projected it.
If I remove "$sort" then the birth date is indeed displayed in the result but its not sorted.
Anybody can help me out?</p>

Body:
I have db of the kind below

{
  "_id": {
    "$oid": "5fd0bbae2fc35ebd500d91c6"
  },
  "movie_id": "0055657",
  "title": "The Alfred Hitchcock Hour",
  "year": "1962",
  "length": 50,
  "crew": [
    {
      "person_id": "0381638",
      "give_name": "Gordon Hessler",
      "birth_date": {
        "$date": {
          "$numberLong": "-1390262400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1390089600000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0516093",
      "give_name": "Norman Lloyd",
      "birth_date": {
        "$date": {
          "$numberLong": "-1740355200000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0365661",
      "give_name": "Joan Harrison",
      "birth_date": {
        "$date": {
          "$numberLong": "-1972944000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "776822400000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0171050",
      "give_name": "Herbert Coleman",
      "birth_date": {
        "$date": {
          "$numberLong": "-1958342400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1002067200000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0001888",
      "give_name": "Robert Douglas",
      "birth_date": {
        "$date": {
          "$numberLong": "-1898035200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "916012800000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0751063",
      "give_name": "Charles Russell",
      "role": "producer"
    },
    {
      "person_id": "0277643",
      "give_name": "Morton S. Fine",
      "birth_date": {
        "$date": {
          "$numberLong": "-1673222400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "668304000000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0295053",
      "give_name": "David Friedkin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1824595200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "214185600000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0723629",
      "give_name": "David Lowell Rich",
      "birth_date": {
        "$date": {
          "$numberLong": "-1556928000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1003622400000"
        }
      },
      "role": "producer"
    },
    {
      "person_id": "0458033",
      "give_name": "Alf Kjellin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1572912000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "576201600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0628149",
      "give_name": "Joseph M. Newman",
      "birth_date": {
        "$date": {
          "$numberLong": "-1906156800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1137974400000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0320637",
      "give_name": "Bernard Girard",
      "birth_date": {
        "$date": {
          "$numberLong": "-1636502400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "883440000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0103975",
      "give_name": "John Brahm",
      "birth_date": {
        "$date": {
          "$numberLong": "-2410128000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "403228800000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0678928",
      "give_name": "Joseph Pevney",
      "birth_date": {
        "$date": {
          "$numberLong": "-1839715200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1211068800000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0366314",
      "give_name": "Harvey Hart",
      "birth_date": {
        "$date": {
          "$numberLong": "-1304553600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "627609600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0828720",
      "give_name": "Robert Stevens",
      "birth_date": {
        "$date": {
          "$numberLong": "-1548892800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "618451200000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0001888",
      "give_name": "Robert Douglas",
      "birth_date": {
        "$date": {
          "$numberLong": "-1898035200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "916012800000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0806915",
      "give_name": "Jack Smight",
      "birth_date": {
        "$date": {
          "$numberLong": "-1414281600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1062374400000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0295053",
      "give_name": "David Friedkin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1824595200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "214185600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0516093",
      "give_name": "Norman Lloyd",
      "birth_date": {
        "$date": {
          "$numberLong": "-1740355200000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0189075",
      "give_name": "Alan Crosland Jr.",
      "birth_date": {
        "$date": {
          "$numberLong": "-1623801600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1008633600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0202297",
      "give_name": "Herschel Daugherty",
      "birth_date": {
        "$date": {
          "$numberLong": "-1867622400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "731289600000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0001628",
      "give_name": "Sydney Pollack",
      "birth_date": {
        "$date": {
          "$numberLong": "-1120435200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1211760000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0723629",
      "give_name": "David Lowell Rich",
      "birth_date": {
        "$date": {
          "$numberLong": "-1556928000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1003622400000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0070670",
      "give_name": "Laslo Benedek",
      "birth_date": {
        "$date": {
          "$numberLong": "-2045779200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "700272000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0604702",
      "give_name": "Harry Morgan",
      "birth_date": {
        "$date": {
          "$numberLong": "-1727136000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1323216000000"
        }
      },
      "role": "director"
    },
    {
      "person_id": "0108745",
      "give_name": "James Bridges",
      "birth_date": {
        "$date": {
          "$numberLong": "-1070150400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "739324800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0805748",
      "give_name": "Henry Slesar",
      "birth_date": {
        "$date": {
          "$numberLong": "-1343001600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1017705600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0743232",
      "give_name": "Arthur A. Ross",
      "birth_date": {
        "$date": {
          "$numberLong": "-1574985600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1226361600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0088645",
      "give_name": "Robert Bloch",
      "birth_date": {
        "$date": {
          "$numberLong": "-1664409600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "780278400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0370883",
      "give_name": "Alfred Hayes",
      "birth_date": {
        "$date": {
          "$numberLong": "-1852675200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "492825600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0330664",
      "give_name": "William D. Gordon",
      "birth_date": {
        "$date": {
          "$numberLong": "-1640736000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "681955200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0506087",
      "give_name": "Richard Levinson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1117238400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "542505600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0512894",
      "give_name": "William Link",
      "birth_date": {
        "$date": {
          "$numberLong": "-1137542400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0277643",
      "give_name": "Morton S. Fine",
      "birth_date": {
        "$date": {
          "$numberLong": "-1673222400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "668304000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0295053",
      "give_name": "David Friedkin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1824595200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "214185600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0613732",
      "give_name": "Joel Murcott",
      "birth_date": {
        "$date": {
          "$numberLong": "-1728259200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "256435200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0203405",
      "give_name": "Lewis Davidson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1363305600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "645580800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0528530",
      "give_name": "Barré Lyndon",
      "birth_date": {
        "$date": {
          "$numberLong": "-2315865600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "88646400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0275848",
      "give_name": "Richard Fielder",
      "role": "writer"
    },
    {
      "person_id": "0375355",
      "give_name": "Lukas Heller",
      "birth_date": {
        "$date": {
          "$numberLong": "-1244937600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "594432000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0558577",
      "give_name": "Richard Matheson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1384214400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1371945600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709351",
      "give_name": "Lou Rambeau",
      "role": "writer"
    },
    {
      "person_id": "0082941",
      "give_name": "John Bingham",
      "birth_date": {
        "$date": {
          "$numberLong": "-1930089600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "586828800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0062629",
      "give_name": "Paul Winterton",
      "birth_date": {
        "$date": {
          "$numberLong": "-1952985600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "978912000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0269623",
      "give_name": "William Fay",
      "birth_date": {
        "$date": {
          "$numberLong": "-1637020800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "347155200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1664770",
      "give_name": "Robert Arthur",
      "birth_date": {
        "$date": {
          "$numberLong": "-1897948800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-21081600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0102824",
      "give_name": "Leigh Brackett",
      "birth_date": {
        "$date": {
          "$numberLong": "-1706313600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "258940800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0437320",
      "give_name": "Henry Kane",
      "role": "writer"
    },
    {
      "person_id": "1707646",
      "give_name": "Andrew Benedict",
      "role": "writer"
    },
    {
      "person_id": "0344181",
      "give_name": "Davis Grubb",
      "birth_date": {
        "$date": {
          "$numberLong": "-1591920000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "333244800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0587743",
      "give_name": "Oscar Millard",
      "birth_date": {
        "$date": {
          "$numberLong": "-1951430400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "660528000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0001969",
      "give_name": "Ray Bradbury",
      "birth_date": {
        "$date": {
          "$numberLong": "-1557705600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1338854400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0728567",
      "give_name": "Jack Ritchie",
      "birth_date": {
        "$date": {
          "$numberLong": "-1509926400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "419904000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709246",
      "give_name": "Stanley Abbott",
      "role": "writer"
    },
    {
      "person_id": "0855704",
      "give_name": "Anthony Terpiloff",
      "birth_date": {
        "$date": {
          "$numberLong": "-1288224000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "254793600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0306664",
      "give_name": "John Garden",
      "role": "writer"
    },
    {
      "person_id": "0308177",
      "give_name": "Oliver H.P. Garrett",
      "birth_date": {
        "$date": {
          "$numberLong": "-2387491200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-563587200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0531792",
      "give_name": "John D. MacDonald",
      "birth_date": {
        "$date": {
          "$numberLong": "-1686441600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "536112000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0698115",
      "give_name": "V.S. Pritchett",
      "birth_date": {
        "$date": {
          "$numberLong": "-2178835200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "858816000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709355",
      "give_name": "Samuel Rogers",
      "role": "writer"
    },
    {
      "person_id": "1713448",
      "give_name": "Charles Runyon",
      "role": "writer"
    },
    {
      "person_id": "0941280",
      "give_name": "Cornell Woolrich",
      "birth_date": {
        "$date": {
          "$numberLong": "-2085264000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-40003200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0068666",
      "give_name": "George Bellak",
      "birth_date": {
        "$date": {
          "$numberLong": "-1600992000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1035244800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0086671",
      "give_name": "Nicholas Blake",
      "birth_date": {
        "$date": {
          "$numberLong": "-2072736000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "75340800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1707649",
      "give_name": "Amber Dean",
      "birth_date": {
        "$date": {
          "$numberLong": "-2116108800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "486604800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0225779",
      "give_name": "Francis Didelot",
      "role": "writer"
    },
    {
      "person_id": "0260012",
      "give_name": "Lee Erwin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1997740800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "66441600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0294016",
      "give_name": "Celia Fremlin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1752537600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1245110400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1113277",
      "give_name": "Robert Gould",
      "role": "writer"
    },
    {
      "person_id": "0375925",
      "give_name": "Elizabeth Hely",
      "role": "writer"
    },
    {
      "person_id": "0452134",
      "give_name": "Roland Kibbee",
      "birth_date": {
        "$date": {
          "$numberLong": "-1763337600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "460512000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1707657",
      "give_name": "Hilda Lawrence",
      "role": "writer"
    },
    {
      "person_id": "0523269",
      "give_name": "Marie Belloc Lowndes",
      "birth_date": {
        "$date": {
          "$numberLong": "-3200083200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-698457600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0748111",
      "give_name": "Mann Rubin",
      "birth_date": {
        "$date": {
          "$numberLong": "-1327276800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1381536000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0843387",
      "give_name": "Julian Symons",
      "birth_date": {
        "$date": {
          "$numberLong": "-1817424000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "785203200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709380",
      "give_name": "Robert Twohy",
      "role": "writer"
    },
    {
      "person_id": "0912451",
      "give_name": "Douglas Warner",
      "role": "writer"
    },
    {
      "person_id": "1713404",
      "give_name": "Robert Branson",
      "role": "writer"
    },
    {
      "person_id": "1709265",
      "give_name": "Thomas H. Cannan Jr.",
      "birth_date": {
        "$date": {
          "$numberLong": "-1129161600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "722995200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0269879",
      "give_name": "Kenneth Fearing",
      "birth_date": {
        "$date": {
          "$numberLong": "-2127945600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-268790400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1088301",
      "give_name": "C.B. Gilford",
      "birth_date": {
        "$date": {
          "$numberLong": "-1550793600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1280188800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0393512",
      "give_name": "Randall Hood",
      "birth_date": {
        "$date": {
          "$numberLong": "-1306627200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "209001600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709303",
      "give_name": "S.B. Hough",
      "role": "writer"
    },
    {
      "person_id": "1493117",
      "give_name": "Veronica Parker Johns",
      "role": "writer"
    },
    {
      "person_id": "1707659",
      "give_name": "Margaret Manners",
      "role": "writer"
    },
    {
      "person_id": "0549924",
      "give_name": "Max Marquis",
      "role": "writer"
    },
    {
      "person_id": "1622374",
      "give_name": "Margaret Millar",
      "birth_date": {
        "$date": {
          "$numberLong": "-1732665600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "764640000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709337",
      "give_name": "Emily Neff",
      "role": "writer"
    },
    {
      "person_id": "1709357",
      "give_name": "Sidney Rowland",
      "role": "writer"
    },
    {
      "person_id": "0811772",
      "give_name": "Boris Sobelman",
      "birth_date": {
        "$date": {
          "$numberLong": "-1902873600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "33955200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0881501",
      "give_name": "Gabrielle Upton",
      "role": "writer"
    },
    {
      "person_id": "0920229",
      "give_name": "H.G. Wells",
      "birth_date": {
        "$date": {
          "$numberLong": "-3259180800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-738028800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0923839",
      "give_name": "Hugh Wheeler",
      "birth_date": {
        "$date": {
          "$numberLong": "-1823644800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "554256000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0943909",
      "give_name": "John Wyndham",
      "birth_date": {
        "$date": {
          "$numberLong": "-2097964800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-25574400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1093689",
      "give_name": "Avram Davidson",
      "birth_date": {
        "$date": {
          "$numberLong": "-1473552000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "736819200000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1707308",
      "give_name": "Richard Deming",
      "birth_date": {
        "$date": {
          "$numberLong": "-1725840000000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "431568000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "1709281",
      "give_name": "Nigel Elliston",
      "role": "writer"
    },
    {
      "person_id": "1709300",
      "give_name": "Larry M. Harris",
      "role": "writer"
    },
    {
      "person_id": "1713422",
      "give_name": "James Holding",
      "role": "writer"
    },
    {
      "person_id": "0397208",
      "give_name": "Clark Howard",
      "role": "writer"
    },
    {
      "person_id": "0414669",
      "give_name": "W.W. Jacobs",
      "birth_date": {
        "$date": {
          "$numberLong": "-3354998400000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-831081600000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0421862",
      "give_name": "Selwyn Jepson",
      "role": "writer"
    },
    {
      "person_id": "0561260",
      "give_name": "André Maurois",
      "birth_date": {
        "$date": {
          "$numberLong": "-2664489600000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "-70588800000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0624776",
      "give_name": "Helen Nielsen",
      "birth_date": {
        "$date": {
          "$numberLong": "-1615507200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1024704000000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0924781",
      "give_name": "Ethel Lina White",
      "role": "writer"
    },
    {
      "person_id": "0996167",
      "give_name": "James Yaffe",
      "birth_date": {
        "$date": {
          "$numberLong": "-1349308800000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "1496534400000"
        }
      },
      "role": "writer"
    },
    {
      "person_id": "0000033",
      "give_name": "Alfred Hitchcock",
      "birth_date": {
        "$date": {
          "$numberLong": "-2221171200000"
        }
      },
      "death_date": {
        "$date": {
          "$numberLong": "325814400000"
        }
      },
      "role": "actor",
      "character": "Alfred Hitchcock - Host"
    }
  ],
  "ratings": [
    {
      "source": "IMDb",
      "rating_date": {
        "$date": {
          "$numberLong": "1509408000000"
        }
      },
      "score": 8.6
    }
  ]
}

I want to query the crew that is still alive, hence where crew.death_date is missing, and then sort them by birth date.
I achieved it this way as it was very simple

db.movie.aggregate([
    {"$unwind": "$crew"},
    {"$match": {"crew.death_date": {"$exists": false}}},
    {"$project": {"crew.give_name": 1, "crew.birth_date": 1}},
    {"$sort": {"crew.birth_date": 1}},
])

However the result is comprised only of the "crew.give_name" and not of the birth date despite i projected it.
If I remove "$sort" then the birth date is indeed displayed in the result but its not sorted.
Anybody can help me out?


问:
AWS File already exists or not (Swift)
I am uploading too many files on AWS S3 and that too of different types.

I am trying to restrict re-uploading to AWS if the same object already persist there.

For this I got listObjectsV2() function but it's response seems too long. If there are 200+ data, this function doesn't seems to be feasible. So I am searching some function, to which I can pass path and it will give me if exist or not.

The default behaviour of AWS is to override the file, but I need to restrict this.

I am new with AWS S3, please do add solutions and thoughts.

I tried listObjectsV2().

I am looking for some function like:
func isAlreadyExist(url: String) {
return true/false
}

Title: AWS File already exists or not (Swift)


问:
SSIS Package Failed in Production
I have got a SSIS Package running in a SQL Server. This Job is continuously failing in the Production.

I am getting the below error

Relevant error information from screenshot.

SQL Server agent running a package in 64 bit mode. SQL Server 2016 SP2, CU17. The SQL command requires 4 parameters, buthte parameter mapping only has 0 parameters. The data flow source "Agreement Mapping" is an Excel Source which failed validation and returned validation status VS_ISBROKEN.

When I Manually run the Package in Visual Studio All the Nodes get executed.

Can someone help me to debug this error

I tried running the package Manually  in Visual Studio and i can see

All the Nodes got executed successfully.

Thanks!
Balaji

Title: SSIS Package Failed in Production


问:
Spring boot considers log4j2.xml as logback config file
I have simple spring boot application:

log4j2.xml:

```<code><?xml version="1.0" encoding="UTF-8"?>
<!-- Extra logging related to initialization of Log4j.
 Set to debug or trace if log4j initialization is failing. -->
<Configuration status="warn">
    <Appenders>
        <!-- Console appender configuration -->
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout
                    pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
        </Console>
    </Appenders>
    <Loggers>
        <!-- Root logger referring to console appender -->
        <Root level="info" additivity="false">
            <AppenderRef ref="console" />
        </Root>
    </Loggers>
</Configuration>
</code>```

pom.xml:

```<code><parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.6</version>
</parent>
 ...
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    ...
   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j2</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>${log4j-slf4j-impl.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j-core.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-layout-template-json</artifactId>
        <version>2.19.0</version>
        <scope>runtime</scope>
    </dependency>
</code>```

When I start the application I see the following error:

```<code>Logging system failed to initialize using configuration from 'classpath:log4j2.xml'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:17 - no applicable action for [Properties], current ElementPath  is [[Configuration][Properties]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:42 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:50 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:56 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:44 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:49 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:46 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@26:50 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@27:43 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@28:34 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:34 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:34 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@31:38 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@32:39 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@34:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@35:52 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
...
</code>```

Looks like spring-boot try to parse log4j2 configuration like logback config file.

How can I fix it ?

Update 1

In effective pom I see following logback related sections:

```<code>     <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-access</artifactId>
        <version>1.2.11</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.11</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.2.11</version>
      </dependency>

    <dependency>
      <groupId>net.logstash.logback</groupId>
      <artifactId>logstash-logback-encoder</artifactId>
      <version>7.2</version>
      <scope>compile</scope>
    </dependency>

      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-logback</artifactId>
        <version>4.2.13</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_logback</artifactId>
        <version>0.15.0</version>
      </dependency>
        <dependency>
      <groupId>net.logstash.logback</groupId>
      <artifactId>logstash-logback-encoder</artifactId>
      <version>7.2</version>
      <scope>compile</scope>
    </dependency>
</code>```

related ch.qos.logback depdendency:tree result:

```<code>[INFO] +- org.liquibase:liquibase-core:jar:3.8.9:compile
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] |  |  \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] |  \- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] |     \- ch.qos.logback:logback-core:jar:1.2.11:compile
</code>```

Update 2:

I've corrected depdency like this:

```<code>    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <exclusions>
            <exclusion>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</code>```

But I still see the initial error but depdendency:tree doesn't return any logback-classic

Update 3:

After project update in intellij I see another error:

```<code>ERROR StatusLogger Unable to create Lookup for ctx
 java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ServiceLoaderUtil
    at org.apache.logging.log4j.core.impl.ThreadContextDataInjector.getServiceProviders(ThreadContextDataInjector.java:77)
</code>```

Body:
I have simple spring boot application:

log4j2.xml:

<?xml version="1.0" encoding="UTF-8"?>

<Configuration status="warn">
    <Appenders>

        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout
                    pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
        </Console>
    </Appenders>
    <Loggers>

        <Root level="info" additivity="false">
            <AppenderRef ref="console" />
        </Root>
    </Loggers>
</Configuration>

pom.xml:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.6</version>
</parent>
 ...
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    ...
   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j2</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>${log4j-slf4j-impl.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j-core.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-layout-template-json</artifactId>
        <version>2.19.0</version>
        <scope>runtime</scope>
    </dependency>

When I start the application I see the following error:

Logging system failed to initialize using configuration from 'classpath:log4j2.xml'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:17 - no applicable action for [Properties], current ElementPath  is [[Configuration][Properties]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:42 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:50 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:56 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:44 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:49 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:46 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@26:50 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@27:43 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@28:34 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:34 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:34 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@31:38 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@32:39 - no applicable action for [Property], current ElementPath  is [[Configuration][Properties][Property]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@34:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@35:52 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
...

Looks like spring-boot try to parse log4j2 configuration like logback config file.

How can I fix it ?

Update 1

In effective pom I see following logback related sections:

     <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-access</artifactId>
        <version>1.2.11</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.11</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.2.11</version>
      </dependency>

    <dependency>
      <groupId>net.logstash.logback</groupId>
      <artifactId>logstash-logback-encoder</artifactId>
      <version>7.2</version>
      <scope>compile</scope>
    </dependency>

      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-logback</artifactId>
        <version>4.2.13</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_logback</artifactId>
        <version>0.15.0</version>
      </dependency>
        <dependency>
      <groupId>net.logstash.logback</groupId>
      <artifactId>logstash-logback-encoder</artifactId>
      <version>7.2</version>
      <scope>compile</scope>
    </dependency>

related ch.qos.logback depdendency:tree result:

[INFO] +- org.liquibase:liquibase-core:jar:3.8.9:compile
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] |  |  \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] |  \- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] |     \- ch.qos.logback:logback-core:jar:1.2.11:compile

Update 2:

I've corrected depdency like this:

    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <exclusions>
            <exclusion>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

But I still see the initial error but depdendency:tree doesn't return any logback-classic

Update 3:

After project update in intellij I see another error:

ERROR StatusLogger Unable to create Lookup for ctx
 java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ServiceLoaderUtil
    at org.apache.logging.log4j.core.impl.ThreadContextDataInjector.getServiceProviders(ThreadContextDataInjector.java:77)


问:
Trying to get property 'photos' of non-object Laravel 8
I try to show image from product_galleries table with related to products table but I got this error. In my products table have 'id' field and in products galleries have 'products_id' field. I already try to google it but still don't get the answer to solve my problem

Thank you

Here is my home.blade.php

```<code><div class="row">
                    @php $incrementProduct = 0 @endphp
                    @forelse ($products as $product)
                        <div
                            class="col-6 col-md-4 col-lg-3"
                            data-aos="fade-up"
                            data-aos-delay="{{ $incrementProduct+=100 }}" >
                            <a href="{{ route('detail', $product->slug) }}" class="component-products d-block">
                                <div class="products-thumbnail">
                                    <div
                                        class="products-image"
                                        style="
                                            @if($product->galleries)
                                                background-image: url('{{ Storage::url($product->galleries->first()->photos) }}')

                                            @else
                                                background-color: #eee"
                                            @endif
                                    >
                                    </div>
                                </div>
                                <div class="products-text">{{ $product->name }}</div>
                                <div class="products-price">{{ $product->price }}</div>
                            </a>
                        </div>
                    @empty
                        <div class="col-12 text-center py-5" data-aos="fade-up"
                            data-aos-delay="100">
                            No Product Found
                        </div>
                    @endforelse

                </div>
</code>```

My HomeController.php

```<code>class HomeController extends Controller
{

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
    public function index()
    {
        $categories = Category::take(6)->get();
        $products = Product::with(['galleries'])->take(8)->get();

        return view('pages.home', [
            'categories' => $categories,
            'products' => $products
        ]);
    }
}
</code>```

My Product.php Model

```<code>class Product extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'name', 'users_id', 'categories_id', 'price', 'description', 'slug'
    ];

    protected $hidden = [

    ];

    public function galleries() {
        return $this->hasMany(ProductGallery::class, 'products_id', 'id');
    }

    public function user() {
        return $this->hasOne(User::class, 'id', 'users_id');
    }

    public function category() {
        return $this->belongsTo(Category::class, 'categories_id', 'id');
    }
}
</code>```

My ProductGallery.php Model

```<code>class ProductGallery extends Model
{

    protected $fillable = [
        'photos', 'products_id'
    ];

    protected $hidden = [

    ];

    public function product() {
        return $this->belongsTo(Product::class, 'products_id', 'id');
    }
}
</code>```

Body:
I try to show image from product_galleries table with related to products table but I got this error. In my products table have 'id' field and in products galleries have 'products_id' field. I already try to google it but still don't get the answer to solve my problem

Thank you

Here is my home.blade.php

                    @php $incrementProduct = 0 @endphp
                    @forelse ($products as $product)

                            slug) }}" class="component-products d-block">

galleries)
                                                background-image: url('{{ Storage::url($product->galleries->first()->photos) }}')

                                            @else
                                                background-color: #eee"
                                            @endif
                                    >

{{ $product->name }}

{{ $product->price }}

                    @empty

                            No Product Found

                    @endforelse

My HomeController.php

class HomeController extends Controller
{

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
    public function index()
    {
        $categories = Category::take(6)->get();
        $products = Product::with(['galleries'])->take(8)->get();

        return view('pages.home', [
            'categories' => $categories,
            'products' => $products
        ]);
    }
}

My Product.php Model

class Product extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'name', 'users_id', 'categories_id', 'price', 'description', 'slug'
    ];

    protected $hidden = [

    ];

    public function galleries() {
        return $this->hasMany(ProductGallery::class, 'products_id', 'id');
    }

    public function user() {
        return $this->hasOne(User::class, 'id', 'users_id');
    }

    public function category() {
        return $this->belongsTo(Category::class, 'categories_id', 'id');
    }
}

My ProductGallery.php Model

class ProductGallery extends Model
{

    protected $fillable = [
        'photos', 'products_id'
    ];

    protected $hidden = [

    ];

    public function product() {
        return $this->belongsTo(Product::class, 'products_id', 'id');
    }
}


问:
On which table/how can we query SQL commands like 'show tables' in an Entity Framework in java
We are using Entity framework to retrieve data from database in our application. I'm at a point where I have to use a command 'show tables'. Until now, I've created Entities for each table and a respective Repository class and wrote the the queries related to the table in the Repo class. Now, inorder to run generic sql queries which are not specific to any table I'm unable to determine where do I write it on JAVA end. Any suggestions are appreciated. Thanks in advance!

One way I've tried doing this is by including the query in any Repo class but that dosen't seem to be a good approach. I would like to know if there is a better or an actual way that this can be done that I'm missing.


问:
Winapi application. Visual C++ 2022's LoadImage is not loading a large system icon
I am working on some programmatic pop-up windows, most things are working fine, there's only one exception.

I am trying to set it up so that I can specify whether to use standard or large icons in the pop-up windows. Unfortunately, there is a glitch in my understanding of LoadImage (I'll be nice, besides it's probably me). To test the large icon code, I'm setting the value directly, normally I'd have a way to select between normal and large but that's not the part that's giving me headaches.

```<code>uint8_t iIconSize = 64;
HICON hIconDlgType = static_cast<HICON>(::LoadImage(NULL, MAKEINTRESOURCE(IDI_ERROR), IMAGE_ICON, iIconSize, iIconSize, LR_DEFAULTCOLOR | LR_SHARED));
</code>```

What I need to know is EITHER what the bug is in my existing code, OR if I can't do it this way, how to resize an icon that has been loaded in by this method. (I need to use system-provided icons for this, so I don't get to use files.)

I'm using Visual Studio 2022 for this.

It makes absolutely no difference what iIconSize is set to, this will load in 32x32 version of the error icon. I was expecting an icon of the specified size (in this case 64x64).

I have tried IDI_INFORMATION and IDI_WARNING to determine if there's an issue with the icon file for IDI_ERROR, but I get the same result.

As I understand it, LoadImage should use the largest valid size of an icon that is equal to or smaller than the size being asked for. The documentation certainly suggests there's a standard 64x64 icon, that you're not restricted to 32x32, and also suggests that the image should be scaled up to the requested size. Neither of these is happening.

I have also tried replacing LoadImage() with LoadIconWithScaleDown() but Visual Studio choked on the MAKEINITRESOURCE(IDI_ERROR) - it complains that LPSTR is incompatible with PCWSTR.

Body:
I am working on some programmatic pop-up windows, most things are working fine, there's only one exception.

I am trying to set it up so that I can specify whether to use standard or large icons in the pop-up windows. Unfortunately, there is a glitch in my understanding of LoadImage (I'll be nice, besides it's probably me). To test the large icon code, I'm setting the value directly, normally I'd have a way to select between normal and large but that's not the part that's giving me headaches.

uint8_t iIconSize = 64;
HICON hIconDlgType = static_cast<HICON>(::LoadImage(NULL, MAKEINTRESOURCE(IDI_ERROR), IMAGE_ICON, iIconSize, iIconSize, LR_DEFAULTCOLOR | LR_SHARED));

What I need to know is EITHER what the bug is in my existing code, OR if I can't do it this way, how to resize an icon that has been loaded in by this method. (I need to use system-provided icons for this, so I don't get to use files.)

I'm using Visual Studio 2022 for this.

It makes absolutely no difference what iIconSize is set to, this will load in 32x32 version of the error icon. I was expecting an icon of the specified size (in this case 64x64).

I have tried IDI_INFORMATION and IDI_WARNING to determine if there's an issue with the icon file for IDI_ERROR, but I get the same result.

As I understand it, LoadImage should use the largest valid size of an icon that is equal to or smaller than the size being asked for. The documentation certainly suggests there's a standard 64x64 icon, that you're not restricted to 32x32, and also suggests that the image should be scaled up to the requested size. Neither of these is happening.

I have also tried replacing LoadImage() with LoadIconWithScaleDown() but Visual Studio choked on the MAKEINITRESOURCE(IDI_ERROR) - it complains that LPSTR is incompatible with PCWSTR.


问:
Application Insights from Bot Framework have stopped working
I have a bot built through Bot Framework Composer.

Application Insights have been working absolutely fine, but I've noticed in the last 2-3 weeks that I'm not getting any data at all in Application Insights:

I've checked my Bot Framework set-up & the endpoint, key and ingestion endpoint are all correct. I've also recreated the API key & put that in the App Service properties but still not getting anything through.

I did see a separate stack post from July about having a certain version of Adaptive Dialog but not sure if that is still relevant?

Anything else I need to check, or anything I'm missing?