问:
How to add textbox search event. Items or listbox is in another wpf page
I want to make searchbox like when I search Items then listbox is show in this page. I have make listbox page is in another wpf window. Can you please help on this I am facing maki problem regarding this.

When I  search listbox Items from MainWindow.Xaml and click button then  of item show in main page. and Items on See software page.

Thankyou!

```<code>MainWindow.xaml

<Window Title="Welcome"  Background="#FFD6D6D6" WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" MouseDown="Window_MouseDown"
AllowsTransparency="True" Height="600" Width="1050">
 <!--Make serchbar -->
                <Grid Background="#2892b5" Grid.Column="3" Margin="10,0,0,0" >
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Viewbox HorizontalAlignment="Left" Margin="22,4,0,0" VerticalAlignment="Center" Width="65">
                        <Image  Source="/Resources/search_32px.png" Height="40" Width="70" />
                    </Viewbox>
                    <Viewbox HorizontalAlignment="Center" Margin="70,4,0,0" VerticalAlignment="Center" >
                        <Label Content="Search for software" FontWeight="Bold" FontSize="20" Foreground="White"  Grid.Row="0"  Width="286"/>
                    </Viewbox>
                    <TextBox Background="White" Foreground="Black" x:Name="search" FontSize="20" Grid.Row="1" TextChanged="TextBox_TextChanged" Margin="37,0,36,38"/>
                    <Button Grid.Row="1" Height="37" Width="37" Background="Transparent" BorderBrush="Transparent" VerticalAlignment="Top" HorizontalAlignment="Right">
                        <Image Source="/View/icons8_right_50px_1.png"/>
                    </Button>

                </Grid>

</code>```

MainWindow.xaml.cs

```<code>    private void SearchClick_Click(object sender, RoutedEventArgs e)
    {

    }
</code>```

SeeSoftware.xaml

```<code><Window Title="SeeSoftware" Height="700" Width="800" WindowStyle="None"  MouseDown="Window_MouseDown">

<ListBox x:Name="Listbox" Foreground="White" FontSize="15" BorderBrush="Transparent"  Background="Transparent">
                                <ListBoxItem Height="50">
                                    <StackPanel Orientation="Horizontal" Margin="20,0,0,0" HorizontalAlignment="Left">
                                        <Image Height="30" Width="30" Source="/Resources/vscode.jpeg"/>
                                        <Label VerticalAlignment="Center" Foreground="White" FontSize="18" Margin="20,0,0,0" Content="Visual Studio code" />
                                        <TextBlock Margin="18,0,0,0" FontSize="18" VerticalAlignment="Center" >
                                  <Hyperlink Foreground="White" NavigateUri="https://az764295.vo.msecnd.net/stable/6261075646f055b99068d3688932416f2346dd3b/VSCodeUserSetup-x64-1.73.1.exe" RequestNavigate="Hyperlink_RequestNavigate">
                                  Install
                                      <Image Height="13" Source="/Resources/icons8_download_26px.png"/>
                                  </Hyperlink>
                                        </TextBlock>
                                    </StackPanel>
                                </ListBoxItem>
</ListBox>

</code>```

Body:
I want to make searchbox like when I search Items then listbox is show in this page. I have make listbox page is in another wpf window. Can you please help on this I am facing maki problem regarding this.

When I  search listbox Items from MainWindow.Xaml and click button then  of item show in main page. and Items on See software page.

Thankyou!

MainWindow.xaml

<Window Title="Welcome"  Background="#FFD6D6D6" WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" MouseDown="Window_MouseDown"
AllowsTransparency="True" Height="600" Width="1050">

                <Grid Background="#2892b5" Grid.Column="3" Margin="10,0,0,0" >
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Viewbox HorizontalAlignment="Left" Margin="22,4,0,0" VerticalAlignment="Center" Width="65">
                        <Image  Source="/Resources/search_32px.png" Height="40" Width="70" />
                    </Viewbox>
                    <Viewbox HorizontalAlignment="Center" Margin="70,4,0,0" VerticalAlignment="Center" >

                    </Viewbox>
                    <TextBox Background="White" Foreground="Black" x:Name="search" FontSize="20" Grid.Row="1" TextChanged="TextBox_TextChanged" Margin="37,0,36,38"/>
                    <Button Grid.Row="1" Height="37" Width="37" Background="Transparent" BorderBrush="Transparent" VerticalAlignment="Top" HorizontalAlignment="Right">
                        <Image Source="/View/icons8_right_50px_1.png"/>
                    </Button>

                </Grid>

MainWindow.xaml.cs

    private void SearchClick_Click(object sender, RoutedEventArgs e)
    {

    }

SeeSoftware.xaml

<Window Title="SeeSoftware" Height="700" Width="800" WindowStyle="None"  MouseDown="Window_MouseDown">

<ListBox x:Name="Listbox" Foreground="White" FontSize="15" BorderBrush="Transparent"  Background="Transparent">
                                <ListBoxItem Height="50">
                                    <StackPanel Orientation="Horizontal" Margin="20,0,0,0" HorizontalAlignment="Left">
                                        <Image Height="30" Width="30" Source="/Resources/vscode.jpeg"/>

                                        <TextBlock Margin="18,0,0,0" FontSize="18" VerticalAlignment="Center" >
                                  <Hyperlink Foreground="White" NavigateUri="https://az764295.vo.msecnd.net/stable/6261075646f055b99068d3688932416f2346dd3b/VSCodeUserSetup-x64-1.73.1.exe" RequestNavigate="Hyperlink_RequestNavigate">
                                  Install
                                      <Image Height="13" Source="/Resources/icons8_download_26px.png"/>
                                  </Hyperlink>
                                        </TextBlock>
                                    </StackPanel>
                                </ListBoxItem>
</ListBox>


来源: stackexchange

问:
postgresql: DB connection was unexpectedly closed while running local chainlink node
I have been trying to run a local chainlink node in Windows 10, WSL1 - Ubuntu Distribution and postgresql 14.5. I am running the following command from WSL shell:

```<code>chainlink local n
</code>```

But, I am getting the following error, displaying that db connection was unexpectedly closed:

```<code>DB connection was unexpectedly closed; checking out a new one pg/advisory_lock.go:178          advisoryLockID=1027321974924625846 err=sql: connection is already closed logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.986+0530 [DEBUG] Taking advisory lock                               pg/advisory_lock.go:132          advisoryLockID=1027321974924625846 logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.988+0530 [FATAL] Another node has taken the advisory lock, exiting immediately pg/advisory_lock.go:191
</code>```

I have tried to set env variables in postgresql.conf file:

```<code>listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'; use '*' for all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
                                        # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
#unix_socket_permissions = 0777         # begin with 0 to use octal notation
                                        # (change requires restart)
#bonjour = off                          # advertise server via Bonjour

tcp_keepalives_idle = 60                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
tcp_keepalives_interval = 60            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
tcp_keepalives_count = 10               # TCP_KEEPCNT;
                                        # 0 selects the system default
tcp_user_timeout = 120                  # TCP_USER_TIMEOUT, in milliseconds;
                                        # 0 selects the system default
</code>```

pg_hba.conf file

```<code>listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'; use '*' for all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
                                        # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
#unix_socket_permissions = 0777         # begin with 0 to use octal notation
                                        # (change requires restart)
#bonjour = off                          # advertise server via Bonjour
</code>```

Precise Terminal Output:

```<code> Listening and serving HTTP on port 6688            cmd/client.go:460                logger=1.10.0@9b1c622
2022-12-13T13:31:48.110+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636533 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.111+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b5",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=a3f6a25f-9052-4382-bf2c-6b99a7ffe8b6
2022-12-13T13:31:48.321+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b5",false] callName=CallContext duration=0.2088953 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=a3f6a25f-9052-4382-bf2c-6b99a7ffe8b6 rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.325+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636532 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.326+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b4",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=REQUEST_ID
2022-12-13T13:31:48.332+0530 [WARN]  DB connection was unexpectedly closed; checking out a new one pg/lease_lock.go:222             appID=33bf14d5-cdf9-4531-a7d3-55ab8e8bc9cd err=leaseLock#GetLease failed: failed to begin transaction: sql: connection is already closed errVerbose=sql: connection is already closed
failed to begin transaction
github.com/smartcontractkit/chainlink/core/services/pg.sqlxTransactionQ
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/transaction.go:91
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).getLease
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:258
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).loop
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:220
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1594
leaseLock#GetLease failed
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).getLease
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:291
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).loop
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:220
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1594 logger=1.10.0@9b1c622.RunNode.LockedDB.LeaseLock
2022-12-13T13:31:48.536+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b4",false] callName=CallContext duration=0.2095203 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=REQUEST_ID rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.540+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636531 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.541+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b3",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=154b805f-348b-415a-b728-d75743023962
2022-12-13T13:31:48.753+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b3",false] callName=CallContext duration=0.2098329 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=154b805f-348b-415a-b728-d75743023962 rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.757+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636530 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.758+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b2",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=1b3ff8e7-4781-4319-bb70-69a709725fc8
2022-12-13T13:31:48.968+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b2",false] callName=CallContext duration=0.209303 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=1b3ff8e7-4781-4319-bb70-69a709725fc8 rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.974+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636529 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.975+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b1",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=a364e758-2f45-47a7-afa7-87c70219b30e
2022-12-13T13:31:48.986+0530 [WARN]  DB connection was unexpectedly closed; checking out a new one pg/advisory_lock.go:178          advisoryLockID=1027321974924625846 err=sql: connection is already closed logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.986+0530 [DEBUG] Taking advisory lock                               pg/advisory_lock.go:132          advisoryLockID=1027321974924625846 logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.988+0530 [FATAL] Another node has taken the advisory lock, exiting immediately pg/advisory_lock.go:191          advisoryLockID=1027321974924625846 logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock stacktrace=github.com/smartcontractkit/chainlink/core/services/pg.(*advisoryLock).loop
</code>```

Is the problem related to advisory locks? Because, localhost:6688 responds for few seconds, then abruptly stops due to the error db connection was unexpectedly closed. Have been into this for around 2 days. Any help is appreciated. Thank you!

ContentLicense: CC BY-SA 4.0

Body:
I have been trying to run a local chainlink node in Windows 10, WSL1 - Ubuntu Distribution and postgresql 14.5. I am running the following command from WSL shell:

chainlink local n

But, I am getting the following error, displaying that db connection was unexpectedly closed:

DB connection was unexpectedly closed; checking out a new one pg/advisory_lock.go:178          advisoryLockID=1027321974924625846 err=sql: connection is already closed logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.986+0530 [DEBUG] Taking advisory lock                               pg/advisory_lock.go:132          advisoryLockID=1027321974924625846 logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.988+0530 [FATAL] Another node has taken the advisory lock, exiting immediately pg/advisory_lock.go:191

I have tried to set env variables in postgresql.conf file:

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'; use '*' for all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
                                        # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
#unix_socket_permissions = 0777         # begin with 0 to use octal notation
                                        # (change requires restart)
#bonjour = off                          # advertise server via Bonjour

tcp_keepalives_idle = 60                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
tcp_keepalives_interval = 60            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
tcp_keepalives_count = 10               # TCP_KEEPCNT;
                                        # 0 selects the system default
tcp_user_timeout = 120                  # TCP_USER_TIMEOUT, in milliseconds;
                                        # 0 selects the system default

pg_hba.conf file

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'; use '*' for all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
                                        # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
#unix_socket_permissions = 0777         # begin with 0 to use octal notation
                                        # (change requires restart)
#bonjour = off                          # advertise server via Bonjour

Precise Terminal Output:

 Listening and serving HTTP on port 6688            cmd/client.go:460                logger=1.10.0@9b1c622
2022-12-13T13:31:48.110+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636533 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.111+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b5",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=a3f6a25f-9052-4382-bf2c-6b99a7ffe8b6
2022-12-13T13:31:48.321+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b5",false] callName=CallContext duration=0.2088953 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=a3f6a25f-9052-4382-bf2c-6b99a7ffe8b6 rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.325+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636532 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.326+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b4",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=REQUEST_ID
2022-12-13T13:31:48.332+0530 [WARN]  DB connection was unexpectedly closed; checking out a new one pg/lease_lock.go:222             appID=33bf14d5-cdf9-4531-a7d3-55ab8e8bc9cd err=leaseLock#GetLease failed: failed to begin transaction: sql: connection is already closed errVerbose=sql: connection is already closed
failed to begin transaction
github.com/smartcontractkit/chainlink/core/services/pg.sqlxTransactionQ
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/transaction.go:91
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).getLease
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:258
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).loop
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:220
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1594
leaseLock#GetLease failed
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).getLease
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:291
github.com/smartcontractkit/chainlink/core/services/pg.(*leaseLock).loop
        /mnt/d/D/Langs/Blockchain/transaction-checker/chainlink/core/services/pg/lease_lock.go:220
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1594 logger=1.10.0@9b1c622.RunNode.LockedDB.LeaseLock
2022-12-13T13:31:48.536+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b4",false] callName=CallContext duration=0.2095203 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=REQUEST_ID rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.540+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636531 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.541+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b3",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=154b805f-348b-415a-b728-d75743023962
2022-12-13T13:31:48.753+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b3",false] callName=CallContext duration=0.2098329 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=154b805f-348b-415a-b728-d75743023962 rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.757+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636530 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.758+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b2",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=1b3ff8e7-4781-4319-bb70-69a709725fc8
2022-12-13T13:31:48.968+0530 [DEBUG] evmclient.Client#CallContext RPC call success      client/node.go:945               args=["0x1c437b2",false] callName=CallContext duration=0.209303 evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=1b3ff8e7-4781-4319-bb70-69a709725fc8 rpcDomain=polished-divine-owl.matic-testnet.discover.quiknode.pro
2022-12-13T13:31:48.974+0530 [DEBUG] Fetching head                                      headtracker/head_tracker.go:331  blockHeight=29636529 evmChainID=80001 logger=1.10.0@9b1c622.EVM.HeadTracker
2022-12-13T13:31:48.975+0530 [DEBUG] RPC call: evmclient.Client#CallContext             client/node.go:426               args=["0x1c437b1",false] evmChainID=80001 logger=1.10.0@9b1c622.EVM.Node.RPC method=eth_getBlockByNumber mode=websocket node=(primary)primary-0-80001:wss://polished-divine-owl.matic-testnet.discover.quiknode.pro/API_KEY/ nodeName=primary-0-80001 nodeTier=primary requestID=a364e758-2f45-47a7-afa7-87c70219b30e
2022-12-13T13:31:48.986+0530 [WARN]  DB connection was unexpectedly closed; checking out a new one pg/advisory_lock.go:178          advisoryLockID=1027321974924625846 err=sql: connection is already closed logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.986+0530 [DEBUG] Taking advisory lock                               pg/advisory_lock.go:132          advisoryLockID=1027321974924625846 logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock
2022-12-13T13:31:48.988+0530 [FATAL] Another node has taken the advisory lock, exiting immediately pg/advisory_lock.go:191          advisoryLockID=1027321974924625846 logger=1.10.0@9b1c622.RunNode.LockedDB.AdvisoryLock stacktrace=github.com/smartcontractkit/chainlink/core/services/pg.(*advisoryLock).loop

Is the problem related to advisory locks? Because, localhost:6688 responds for few seconds, then abruptly stops due to the error db connection was unexpectedly closed. Have been into this for around 2 days. Any help is appreciated. Thank you!


问:
Remote triggers on Adobe XD Prototype
I need to create a prototype of a phone receiving an incoming call using Adobe XD, that is controlled remotely. Ideally, I would hook up a Bluetooth device (a keyboard for example) and trigger the movent from an artboard that's back (to simulate the phone being off) to an incoming call screen. Does anyone know a way of achieving this in Adobe XD?</p>

Title: Remote triggers on Adobe XD Prototype


问:
Why are some images not able to convert from ARGB_8888 to RGB_565?
I am working with bitmaps in Android, and I am reading Android documentation about bitmap. There is a parameter in Bitmap.Options called inPreferredConfig

The description of inPreferredConfig shows below:

If this is non-null, the decoder will try to decode into this internal configuration. If it is null, or the request cannot be met, the decoder will try to pick the best matching config based on the system's screen depth, and characteristics of the original image such as if it has per-pixel alpha (requiring a config that also does).

Therefore, I want to know when the image cannot be converted to RGB_565?

I try to set some images with RGB_565 but some of them show ARGB_8888 config. I also know that only ARGB_8888 works with transparency. Another fact is that there is less description in Android documentation about this aspect.


问:
React 'Cannot set properties to undefined': expensive computation?
I have an issue while rendering the following.
I have a useBoard hook, which should create a new board: a 2d Array, which every cell is an object, in which some of these object have a value between 1-3 included, and the other 'empty cells' have the 0 value.

Cell object:

```<code>{
  value: 0,
  className: ''
}
</code>```

My useBoard simply call the function to create the board.

```<code>export const useBoard = ({ rows, columns, pieces }: IBoardItems) => {
  const [board, setBoard] = useState<ICell[][]>();

  useEffect(() => {
    const getBoard = () => {
      const newBoard = createBoard({ rows, columns, pieces });
      setBoard(newBoard);
    }
    getBoard();
  }, [])

  return [board] as const;
};
</code>```

And here is the utility function to build it.

```<code>export const createBoard = ({ rows, columns, pieces }: IBoardItems) => {
  let randomIndexes: number[][] = [];
  while (randomIndexes.length < pieces) {
    let randomIndex = [getRandomNumber(5, rows), getRandomNumber(0, columns)];
    if (randomIndexes.includes(randomIndex)) {
      continue;
    } else {
      randomIndexes.push(randomIndex);
    };
  };

  let board: ICell[][] = [];
  for (let i = 0; i < rows; i++) {
    board.push(Array(columns).fill(defaultCell));
  };

  randomIndexes.forEach(([y, x]) => {
    board[y][x] = {
      value: getRandomNumber(1, 3),
      className: ''
    }
  });
  return board;
};
</code>```

The fact is, that when I click start in my related component, which should render the <Game /> containing the <Board />, sometimes it works, sometimes not, and the console logs the error 'Cannot set properties to undefined'. I think I understand but I'm not sure: is it because could happen, that in some steps, some data is not ready to work with other data?
So, in this such of cases, which would be the best approach? Callbacks? Promises? Async/await?

NB. Before, I splitted the createBoard function into smaller functions, each one with its owns work, but to understand the issue I tried to make only one big, but actually I would like to re-split it.

EDIT: I maybe found the issue. In the createBoard I used getRandomNumber which actualy goes over the array length. Now the problem no longer occurs, but anyway, my question are not answered.

Body:
I have an issue while rendering the following.
I have a useBoard hook, which should create a new board: a 2d Array, which every cell is an object, in which some of these object have a value between 1-3 included, and the other 'empty cells' have the 0 value.

Cell object:

{
  value: 0,
  className: ''
}

My useBoard simply call the function to create the board.

export const useBoard = ({ rows, columns, pieces }: IBoardItems) => {
  const [board, setBoard] = useState<ICell[][]>();

  useEffect(() => {
    const getBoard = () => {
      const newBoard = createBoard({ rows, columns, pieces });
      setBoard(newBoard);
    }
    getBoard();
  }, [])

  return [board] as const;
};

And here is the utility function to build it.

export const createBoard = ({ rows, columns, pieces }: IBoardItems) => {
  let randomIndexes: number[][] = [];
  while (randomIndexes.length < pieces) {
    let randomIndex = [getRandomNumber(5, rows), getRandomNumber(0, columns)];
    if (randomIndexes.includes(randomIndex)) {
      continue;
    } else {
      randomIndexes.push(randomIndex);
    };
  };

  let board: ICell[][] = [];
  for (let i = 0; i < rows; i++) {
    board.push(Array(columns).fill(defaultCell));
  };

  randomIndexes.forEach(([y, x]) => {
    board[y][x] = {
      value: getRandomNumber(1, 3),
      className: ''
    }
  });
  return board;
};

The fact is, that when I click start in my related component, which should render the <Game /> containing the <Board />, sometimes it works, sometimes not, and the console logs the error 'Cannot set properties to undefined'. I think I understand but I'm not sure: is it because could happen, that in some steps, some data is not ready to work with other data?
So, in this such of cases, which would be the best approach? Callbacks? Promises? Async/await?

NB. Before, I splitted the createBoard function into smaller functions, each one with its owns work, but to understand the issue I tried to make only one big, but actually I would like to re-split it.

EDIT: I maybe found the issue. In the createBoard I used getRandomNumber which actualy goes over the array length. Now the problem no longer occurs, but anyway, my question are not answered.


问:
Need to know the EOL for Apache Tomcat 8.5
Need to know the EOL for Apache Tomcat 8.5 since no where it is mention the EOL for tomcat 8.5 version 8.8.85 still the change log is updated for 9th Dec

Checked the below site.

https://en.wikipedia.org/wiki/Apache_Tomcat

https://tomcat.apache.org/tomcat-8.5-doc/index.html

https://tomcat.apache.org/tomcat-8.5-doc/changelog.html

https://www.tomitribe.com/legal/lifecycle-policy/

https://www.oracle.com/java/technologies/java-se-support-roadmap.html


问:
Slow framerate (fps) and lag with getUserMedia video
I'm displaying a webcam with:

navigator.mediaDevices.getUserMedia({ audio: false, video: { width: { min: 320, max: 1080 }, height: { min: 200, max: 720 }, frameRate: { min: 15, max: 25 }}}).then(stream => {
    document.querySelector(".cam").srcObject = stream;
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><video autoplay="true" class="cam"></video></code>```

I have tested various combinations of the parameters (width, height, framerate), but the following problem is always the same.

Problem:

On Windows 7 + Chromium 103, the video is smooth, high FPS

On Windows 10 + Chromium 103, the video is lagging with a low FPS, sometimes with pauses

On Windows 10 + latest Firefox, it's smooth, high FPS

On Windows 10 + another software that has access to the webcam (standalone .exe to test webcam) , it's smooth, high FPS

I have installed the latest Intel graphic card drivers on both.

I need this to work on this specific computer (for a kiosk embedded application).

How to debug such a getUserMedia problem?

Is there a way to display browser internal diagnostic information for getUserMedia?

Body:
I'm displaying a webcam with:

navigator.mediaDevices.getUserMedia({ audio: false, video: { width: { min: 320, max: 1080 }, height: { min: 200, max: 720 }, frameRate: { min: 15, max: 25 }}}).then(stream => {
    document.querySelector(".cam").srcObject = stream;
});

<video autoplay="true" class="cam"></video>

I have tested various combinations of the parameters (width, height, framerate), but the following problem is always the same.

Problem:

On Windows 7 + Chromium 103, the video is smooth, high FPS

On Windows 10 + Chromium 103, the video is lagging with a low FPS, sometimes with pauses

On Windows 10 + latest Firefox, it's smooth, high FPS

On Windows 10 + another software that has access to the webcam (standalone .exe to test webcam) , it's smooth, high FPS

I have installed the latest Intel graphic card drivers on both.

I need this to work on this specific computer (for a kiosk embedded application).

How to debug such a getUserMedia problem?

Is there a way to display browser internal diagnostic information for getUserMedia?


问:
Jenkins - how to create a condition based Jenkins pipeline
I'm trying to create two individual pipelines which should run based on a boolean value. I'm able to create boolean conditions which help to run pipelines, but I'm not getting a proper way to create pipelines.

```<code>stage('creating env') {
    steps {
       dir("${WORKSPACE}/test") {
           echo 'creating work env'
           catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
                sh "python3 -u test.py"
           }
       }
    }
}

   static def test_1() {
              echo 'Running test_1'
              stage('TEST_1') {
                   parallel {
                       steps {
                          script {
                             def startTime = new Date()
                             long l1 = startTime.getTime()
                             Date endTime = new Date()
                            long l2 = endTime.getTime()
                            long diff = l2 - l1
                            long secondInMillis = 1000
                            long minuteInMillis = secondInMillis * 60
                            long hourInMillis = minuteInMillis * 60
                            long elapsedHours = diff / hourInMillis
                            diff = diff % hourInMillis
                            long elapsedMinutes = diff / minuteInMillis
                            diff = diff % minuteInMillis
                            long elapsedSeconds = diff / secondInMillis
                            if (elapsedMinutes>10){
                                buildbadgevdi.setColor('orange')
                            }
                            buildbadgevdi.setStatus("${elapsedMinutes}min ${elapsedSeconds}sec ")

stage('Tests') {
        if (params.Test_1) {
            Test_1()
        }
        if (params.Test_2) {
            Test_2()
        }

    }
}
    post {
</code>```

Same Logic I want repeat in Test_2() with different sets of test.

Above logic is failing with error:
Method definition not expected here. Please define the method at an appropriate place or perhaps try using a block/Closure instead

Body:
I'm trying to create two individual pipelines which should run based on a boolean value. I'm able to create boolean conditions which help to run pipelines, but I'm not getting a proper way to create pipelines.

stage('creating env') {
    steps {
       dir("${WORKSPACE}/test") {
           echo 'creating work env'
           catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
                sh "python3 -u test.py"
           }
       }
    }
}

   static def test_1() {
              echo 'Running test_1'
              stage('TEST_1') {
                   parallel {
                       steps {
                          script {
                             def startTime = new Date()
                             long l1 = startTime.getTime()
                             Date endTime = new Date()
                            long l2 = endTime.getTime()
                            long diff = l2 - l1
                            long secondInMillis = 1000
                            long minuteInMillis = secondInMillis * 60
                            long hourInMillis = minuteInMillis * 60
                            long elapsedHours = diff / hourInMillis
                            diff = diff % hourInMillis
                            long elapsedMinutes = diff / minuteInMillis
                            diff = diff % minuteInMillis
                            long elapsedSeconds = diff / secondInMillis
                            if (elapsedMinutes>10){
                                buildbadgevdi.setColor('orange')
                            }
                            buildbadgevdi.setStatus("${elapsedMinutes}min ${elapsedSeconds}sec ")

stage('Tests') {
        if (params.Test_1) {
            Test_1()
        }
        if (params.Test_2) {
            Test_2()
        }

    }
}
    post {

Same Logic I want repeat in Test_2() with different sets of test.

Above logic is failing with error:
Method definition not expected here. Please define the method at an appropriate place or perhaps try using a block/Closure instead


问:
matplotlib show x ticks on specific subplot
I have the following code that plots 5 subplots with shared x axis.

```<code>dflist=['hprmoak', 'hprmic', 'hprmmc', 'hprmimd', 'hprmmd']
pllist=['oak','ic', 'mc','imd','md',]
nrow=3
ncol=2

fig1, axes =plt.subplots(nrow, ncol, sharex=True)
axes[2][1].set_visible(False)
axes=axes.ravel()

for k in dflist:
    axes[dflist.index(k)].plot(locals()[k]['datetime'], locals()[k][pllist[dflist.index(k)]+'_mean'], label=pllist[dflist.index(k)])
    axes[dflist.index(k)].plot(locals()[k]['datetime'], locals()[k]['eqn 5&6'], label='pred')
    axes[dflist.index(k)].legend()
    axes[dflist.index(k)].tick_params(axis='x', rotation=90)
</code>```

which gives the following result:

I would like to show the x ticks on the subplot at (1)(1). How can i achieve this?

Body:
I have the following code that plots 5 subplots with shared x axis.

dflist=['hprmoak', 'hprmic', 'hprmmc', 'hprmimd', 'hprmmd']
pllist=['oak','ic', 'mc','imd','md',]
nrow=3
ncol=2

fig1, axes =plt.subplots(nrow, ncol, sharex=True)
axes[2][1].set_visible(False)
axes=axes.ravel()

for k in dflist:
    axes[dflist.index(k)].plot(locals()[k]['datetime'], locals()[k][pllist[dflist.index(k)]+'_mean'], label=pllist[dflist.index(k)])
    axes[dflist.index(k)].plot(locals()[k]['datetime'], locals()[k]['eqn 5&6'], label='pred')
    axes[dflist.index(k)].legend()
    axes[dflist.index(k)].tick_params(axis='x', rotation=90)

which gives the following result:

I would like to show the x ticks on the subplot at (1)(1). How can i achieve this?


问:
Unable to start user managed notebook (Error: "You must specify backend ID")
I am setting up a simple user managed notebook instance via terraform/atlantis. The notebook is created fine. But the notebook does not start and keeps failing with:

```<code>systemd[1]: Started Google Notebooks Proxy Agent Service.
bash[1722]: 2022/12/13 10:40:03 You must specify a backend ID
systemd[1]: notebooks_proxy_agent.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: notebooks_proxy_agent.service: Failed with result 'exit-code'.
</code>```

At this stage I would like to just have JupyterLab started and be able to open a notebook.

Body:
I am setting up a simple user managed notebook instance via terraform/atlantis. The notebook is created fine. But the notebook does not start and keeps failing with:

systemd[1]: Started Google Notebooks Proxy Agent Service.
bash[1722]: 2022/12/13 10:40:03 You must specify a backend ID
systemd[1]: notebooks_proxy_agent.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: notebooks_proxy_agent.service: Failed with result 'exit-code'.

At this stage I would like to just have JupyterLab started and be able to open a notebook.


问:
Force redirect to HTTPS
I need to force redirect to HTTPS in the following Trailing Slash RULE.

```<code><rule name="Trailing Slash" stopProcessing="true">
          <match url="(.*[^/])$" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{URL}" pattern="WebResource.axd" negate="true" />
          </conditions>
          <action type="Redirect" url="{R:1}/" redirectType="Permanent" />
        </rule>
</code>```

I need the end result to be of something below:

```<code><rule name="Trailing Slash" stopProcessing="true">
          <match url="(.*[^/])$" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{URL}" pattern="WebResource.axd" negate="true" />
          </conditions>
          <action type="Redirect" url="https://www.somedomain.com/{R:1}/" redirectType="Permanent" />
        </rule>
</code>```

Title: Force redirect to HTTPS

Body:
I need to force redirect to HTTPS in the following Trailing Slash RULE.

<rule name="Trailing Slash" stopProcessing="true">
          <match url="(.*[^/])$" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{URL}" pattern="WebResource.axd" negate="true" />
          </conditions>
          <action type="Redirect" url="{R:1}/" redirectType="Permanent" />
        </rule>

I need the end result to be of something below:

<rule name="Trailing Slash" stopProcessing="true">
          <match url="(.*[^/])$" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{URL}" pattern="WebResource.axd" negate="true" />
          </conditions>
          <action type="Redirect" url="https://www.somedomain.com/{R:1}/" redirectType="Permanent" />
        </rule>


问:
Retention of files in Windows Server
I implemented this for retention of files on my windows server : https://learn.microsoft.com/en-us/windows-server/identity/solution-guides/deploy-implementing-retention-of-information-on-file-servers--demonstration-steps-?tabs=gui

And it worked perfectly. But, I want to do retention by tag not by path.

I think it might be doable in the classification management but I'm not quite sure.

Did anyone try this? Or did a retention of files in a windows server?

Title: Retention of files in Windows Server


问:
How can I create a dataframe calculated with other dataframes
I have two dataframes, the first (df1) only with dates and the second (df2) with dates and values -> see example.
I want to create a third dataframe (df3) with the dates from df1 where the values from df2 are averaged in the period between the dates from df1.
Unfortunatly there is no structured continuity of the dates.

example:

```<code>df1 <- data.frame(
  Date = c(
    "1986-01-15",
    "1986-01-20",
    "1986-01-24",
    "1986-01-28"
  )
)
View(df1)

df2 <- data.frame(
  Date = c(
    "1986-01-16",
    "1986-01-17",
    "1986-01-20",
    "1986-01-21",
    "1986-01-22",
    "1986-01-23",
    "1986-01-24",
    "1986-01-27",
    "1986-01-28"
  ),
  Value = c(6,8,1,7,3,9,1,4,5)
)
View(df2)
</code>```

I hope someone can help. Thank youu!!

the result should be:

```<code>1986-01-15      NA
1986-01-20      (6+8+1)/3 = 5
1986-01-24      (7+3+9+1)/4 = 5
1986-01-28      (4+5)/2 = 4,5
</code>```

Body:
I have two dataframes, the first (df1) only with dates and the second (df2) with dates and values -> see example.
I want to create a third dataframe (df3) with the dates from df1 where the values from df2 are averaged in the period between the dates from df1.
Unfortunatly there is no structured continuity of the dates.

example:

df1 <- data.frame(
  Date = c(
    "1986-01-15",
    "1986-01-20",
    "1986-01-24",
    "1986-01-28"
  )
)
View(df1)

df2 <- data.frame(
  Date = c(
    "1986-01-16",
    "1986-01-17",
    "1986-01-20",
    "1986-01-21",
    "1986-01-22",
    "1986-01-23",
    "1986-01-24",
    "1986-01-27",
    "1986-01-28"
  ),
  Value = c(6,8,1,7,3,9,1,4,5)
)
View(df2)

I hope someone can help. Thank youu!!

the result should be:

1986-01-15      NA
1986-01-20      (6+8+1)/3 = 5
1986-01-24      (7+3+9+1)/4 = 5
1986-01-28      (4+5)/2 = 4,5


问:
Hibernate MappingException: Could not determine type for: java.util.List
'm trying to map a MutableList<ArenaCombatHistory> property in my Gladiator class using Hibernate, but I'm getting the following exception:

```<code>org.hibernate.MappingException: Could not determine type for: java.util.List, at table: gladiator, for columns: [org.hibernate.mapping.Column(history)]
</code>```

Here is my Gladiator class:

```<code>@Entity
@Access(AccessType.PROPERTY)
open class Gladiator(
    id: String = UUID.randomUUID().toString(),
    name: String = "Unnamed Gladiator",
    status: String = "free",
    age: String = "Infant",
    nonPlayer: Boolean = true,
    attributes: Attributes = Attributes(),
    equipment: Equipment = Equipment(),
    @OneToMany(cascade = [CascadeType.ALL], targetEntity = ArenaCombatHistory::class)
    var history: MutableList<ArenaCombatHistory> = mutableListOf()
) : Character(id, name, status, age, nonPlayer, attributes, equipment)
</code>```

And here it's super classes:

```<code>@Entity
@Table(name = "gamecharacter")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
open class Character(
    id: String = UUID.randomUUID().toString(),
    var name: String = "",
    var status: String = "",
    var age: String = "Infant",
    var nonPlayer: Boolean = false,
    @Embedded
    var attributes: Attributes = Attributes(),
    @OneToOne(cascade = [CascadeType.ALL])
    var equipment: Equipment = Equipment()
) : Actor(id)
</code>```
```<code>@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
open class Actor(
    @Id
    open val id: String = UUID.randomUUID().toString()
)
</code>```

I made my Gladiator class open and added targetEntity = ArenaCombatHistory::class the have an explicit class. However it did not help.

Body:
'm trying to map a MutableList<ArenaCombatHistory> property in my Gladiator class using Hibernate, but I'm getting the following exception:

org.hibernate.MappingException: Could not determine type for: java.util.List, at table: gladiator, for columns: [org.hibernate.mapping.Column(history)]

Here is my Gladiator class:

@Entity
@Access(AccessType.PROPERTY)
open class Gladiator(
    id: String = UUID.randomUUID().toString(),
    name: String = "Unnamed Gladiator",
    status: String = "free",
    age: String = "Infant",
    nonPlayer: Boolean = true,
    attributes: Attributes = Attributes(),
    equipment: Equipment = Equipment(),
    @OneToMany(cascade = [CascadeType.ALL], targetEntity = ArenaCombatHistory::class)
    var history: MutableList<ArenaCombatHistory> = mutableListOf()
) : Character(id, name, status, age, nonPlayer, attributes, equipment)

And here it's super classes:

@Entity
@Table(name = "gamecharacter")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
open class Character(
    id: String = UUID.randomUUID().toString(),
    var name: String = "",
    var status: String = "",
    var age: String = "Infant",
    var nonPlayer: Boolean = false,
    @Embedded
    var attributes: Attributes = Attributes(),
    @OneToOne(cascade = [CascadeType.ALL])
    var equipment: Equipment = Equipment()
) : Actor(id)

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
open class Actor(
    @Id
    open val id: String = UUID.randomUUID().toString()
)

I made my Gladiator class open and added targetEntity = ArenaCombatHistory::class the have an explicit class. However it did not help.


问:
Rocket chat: Team to channel conversion error
I am trying to convert a team to a channel, but I receive an error: “team-does-not-exist”. I have noticed this error a few more times, but does not happen always. I tried both via the interface and the API. Attached are the screenshots of the interface with the error corresponding to the team I am trying to convert.


问:
Celery - How to solve PreconditionFailed relating to delivery timeout
In my celery cluster I see that some tasks are killed and restarted automatically. This set of celery workers works on long running tasks. This is the error I see logged by celery worker before death

```<code>"Unrecoverable error: PreconditionFailed(406, 'PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. Timeout value used: 1800000 ms. This timeout value can be configured, see consumers doc guide to learn more', (0, 0), '')"
</code>```

How can I solve this issue?

I am using AWS MQ for running a rabbitmq cluster

Body:
In my celery cluster I see that some tasks are killed and restarted automatically. This set of celery workers works on long running tasks. This is the error I see logged by celery worker before death

"Unrecoverable error: PreconditionFailed(406, 'PRECONDITION_FAILED - delivery acknowledgement on channel 1 timed out. Timeout value used: 1800000 ms. This timeout value can be configured, see consumers doc guide to learn more', (0, 0), '')"

How can I solve this issue?

I am using AWS MQ for running a rabbitmq cluster


问:
Problem receiving data from bluetooth at very high speeds
I'm using the flutter_bluetooth_serial 0.4.0 package, it has a listen function that receives a function that returns the reading of the sending of a string (List Uint8), but for my case I need to carry out the communication at a very high speed, and when that it happens it does not understand where the end of a string is and it joins it until it overflows with 230 bytes and shows it as if it were a single string, I tried to solve this in several ways, but I can only receive the complete string (18 bytes) when I reduce the transmission speed, I've tried using some characters like '\n', to see if it understands where a string ends and another begins, but I wasn't successful either. If I could read character by character for me it would also solve it, because the messages have a sending pattern.
Do you have an idea how I could be solving this? Some package that works better than this one for this purpose or some way to determine where the end of the string is. I thank!

Here is the code snippet I get the data:

```<code>    _dataSubscription = connection.input!.listen(_onDataReceived);

   void _onDataReceived(Uint8List data) {
    print('Data incoming: ${ascii.decode(data)}');

    // Allocate buffer for parsed data
    var backspacesCounter = 0;

    for (var byte in data) {
      if (byte == 8 || byte == 127) backspacesCounter++;
    }

    var buffer = Uint8List(data.length - backspacesCounter);
    var bufferIndex = buffer.length;

    // Apply backspace control character
    backspacesCounter = 0;
    for (int i = data.length - 1; i >= 0; i--) {
      if (data[i] == 8 || data[i] == 127) {
        backspacesCounter++;
      } else {
        if (backspacesCounter > 0) {
          backspacesCounter--;
        } else {
          buffer[--bufferIndex] = data[i];
        }
      }
      // print(backspacesCounter);
      // print(buffer);
      // print(bufferIndex);
    }

</code>```

I've tried using some characters like '\n', to see if it understands where a string ends and another begins, read character per character, but doesn't have function to do this.

Body:
I'm using the flutter_bluetooth_serial 0.4.0 package, it has a listen function that receives a function that returns the reading of the sending of a string (List Uint8), but for my case I need to carry out the communication at a very high speed, and when that it happens it does not understand where the end of a string is and it joins it until it overflows with 230 bytes and shows it as if it were a single string, I tried to solve this in several ways, but I can only receive the complete string (18 bytes) when I reduce the transmission speed, I've tried using some characters like '\n', to see if it understands where a string ends and another begins, but I wasn't successful either. If I could read character by character for me it would also solve it, because the messages have a sending pattern.
Do you have an idea how I could be solving this? Some package that works better than this one for this purpose or some way to determine where the end of the string is. I thank!

Here is the code snippet I get the data:

    _dataSubscription = connection.input!.listen(_onDataReceived);

   void _onDataReceived(Uint8List data) {
    print('Data incoming: ${ascii.decode(data)}');

    // Allocate buffer for parsed data
    var backspacesCounter = 0;

    for (var byte in data) {
      if (byte == 8 || byte == 127) backspacesCounter++;
    }

    var buffer = Uint8List(data.length - backspacesCounter);
    var bufferIndex = buffer.length;

    // Apply backspace control character
    backspacesCounter = 0;
    for (int i = data.length - 1; i >= 0; i--) {
      if (data[i] == 8 || data[i] == 127) {
        backspacesCounter++;
      } else {
        if (backspacesCounter > 0) {
          backspacesCounter--;
        } else {
          buffer[--bufferIndex] = data[i];
        }
      }
      // print(backspacesCounter);
      // print(buffer);
      // print(bufferIndex);
    }

I've tried using some characters like '\n', to see if it understands where a string ends and another begins, read character per character, but doesn't have function to do this.


问:
Does Jenkins GitLab plugin supports the feature like allow_failure in GitLab CI?
I'm using Jenkins GitLab Plugin, and I used gitlabBuild() to tell GitLab that the pipeline will succeed only if all three tasks are successful.

```<code>gitlabBuilds(builds: ['First', 'Second', 'Third']) {}
</code>```

And I need the unexecuted task be cancelled when any task fails, the default behaviour is all the unexecuted task will hang on pending state.

Looks like the allow_failure: false in GitLab CI is indeed what I want:

Use allow_failure to determine whether a pipeline should continue running when a job fails.

To let the pipeline continue running subsequent jobs, use allow_failure: true.

To stop the pipeline from running subsequent jobs, use allow_failure: false.

Does Jenkins GitLab plugin support the feature like allow_failure in GitLab CI?

I've found a workaround which is cancelling the follow stages manually, but it's a little ugly:

```<code>stage('First') {
    steps {
        gitlabCommitStatus(name: 'First') {
            script {
                gitlabBuilds(builds: ['First', 'Second', 'Third']) {}
            }
        }
    }
    post {
        failure {
            updateGitlabCommitStatus name: 'Second', state: 'canceled'
            updateGitlabCommitStatus name: 'Third', state: 'canceled'
        }
    }
}
stage('Second') {
    steps {
        gitlabCommitStatus(name: 'Second') {
            script {
            }
        }
    }
    post {
        failure {
            updateGitlabCommitStatus name: 'Third', state: 'canceled'
        }
    }
}
stage('Third') {
    steps {
        gitlabCommitStatus(name: 'First') {
            script {
            }
        }
    }
}
</code>```

Does someone have a better solution? Thanks.

Body:
I'm using Jenkins GitLab Plugin, and I used gitlabBuild() to tell GitLab that the pipeline will succeed only if all three tasks are successful.

gitlabBuilds(builds: ['First', 'Second', 'Third']) {}

And I need the unexecuted task be cancelled when any task fails, the default behaviour is all the unexecuted task will hang on pending state.

Looks like the allow_failure: false in GitLab CI is indeed what I want:

Use allow_failure to determine whether a pipeline should continue running when a job fails.

To let the pipeline continue running subsequent jobs, use allow_failure: true.

To stop the pipeline from running subsequent jobs, use allow_failure: false.

Does Jenkins GitLab plugin support the feature like allow_failure in GitLab CI?

I've found a workaround which is cancelling the follow stages manually, but it's a little ugly:

stage('First') {
    steps {
        gitlabCommitStatus(name: 'First') {
            script {
                gitlabBuilds(builds: ['First', 'Second', 'Third']) {}
            }
        }
    }
    post {
        failure {
            updateGitlabCommitStatus name: 'Second', state: 'canceled'
            updateGitlabCommitStatus name: 'Third', state: 'canceled'
        }
    }
}
stage('Second') {
    steps {
        gitlabCommitStatus(name: 'Second') {
            script {
            }
        }
    }
    post {
        failure {
            updateGitlabCommitStatus name: 'Third', state: 'canceled'
        }
    }
}
stage('Third') {
    steps {
        gitlabCommitStatus(name: 'First') {
            script {
            }
        }
    }
}

Does someone have a better solution? Thanks.


问:
Magento2 graphQl special_price filter not working
I am trying to retrieve all products holding a special price value.

```<code>{
  products(filter: {

        special_price: { from: "0.00" ,to:"10.00"}
    },
    sort: {
        name: ASC
    }) {
    items {
      name
      sku
      sale
      special_price
      special_from_date
      special_to_date
      price_range {
        minimum_price {
          regular_price {
            value
            currency
          }
          final_price {
            value
            currency
          }
          discount {
            amount_off
            percent_off
          }
        }
      }
    }
  }
}
</code>```

Above is the example query which is trying to run. But it always returns a null result. Does anyone know why it's returning null?

Body:
I am trying to retrieve all products holding a special price value.

{
  products(filter: {

        special_price: { from: "0.00" ,to:"10.00"}
    },
    sort: {
        name: ASC
    }) {
    items {
      name
      sku
      sale
      special_price
      special_from_date
      special_to_date
      price_range {
        minimum_price {
          regular_price {
            value
            currency
          }
          final_price {
            value
            currency
          }
          discount {
            amount_off
            percent_off
          }
        }
      }
    }
  }
}

Above is the example query which is trying to run. But it always returns a null result. Does anyone know why it's returning null?


问:
In-app checkout interface is always in landscape mode on Honeycomb
I'm building application on SKD 11+ (Android 3.x) and when I'm doing in-app billing request the checkout popup is always displaying in landscape mode - causing that my whole app rotates to landscape mode even though the app is locked to portrait!

Is there any way to display purchase popup in portrait mode on Honeycomb? Apparently it has something to do with Android Market which is displaying only in landscape too, as it is responsible for checkout popup.

Thanks.

ContentLicense: CC BY-SA 3.0


问:
Komodo IDE 12 connecting linked files
I have an external javascrypt file holding various functions that are used on my site page however komodo keeps highlighting them as not used. is there a way to link the two pages so it can see that the function is used? i would prefer for komodo to understand they are being used and not turn this functionality off

thanks

i have been through most of the high level menus, no deep dive yet

Title: Komodo IDE 12 connecting linked files


问:
Can I send inline files and Attachments in a single mail using JavaMailSender?
```<code>    MimeMessageHelper helper = new MimeMessageHelper(message, true);

helper.setFrom(from);
        helper.setTo(to);
        helper.setSubject(subject);
        helper.setText(msg);

        // attach the file

FileSystemResource file = new FileSystemResource(new File("c:/rp.jpg"));
        helper.addInline(file.getName(), file); // given file name as contentId in the text

        // attach the file
        FileSystemResource file = new FileSystemResource(new File("c:/rr.jpg"));
        helper.addAttachment("mybrothermage.jpg", file);//image will be sent by this name
</code>```

But in the output inline file position is right.. But I am getting 2 attchments.. One with NoName.jpg and another with mybrotherimage.jpg ?

Is it possible to send both inline files and attachemnts at the same time. If yes.. How can I make only attached files are in the output?

Body:
    MimeMessageHelper helper = new MimeMessageHelper(message, true);

helper.setFrom(from);
        helper.setTo(to);
        helper.setSubject(subject);
        helper.setText(msg);

        // attach the file

FileSystemResource file = new FileSystemResource(new File("c:/rp.jpg"));
        helper.addInline(file.getName(), file); // given file name as contentId in the text

        // attach the file
        FileSystemResource file = new FileSystemResource(new File("c:/rr.jpg"));
        helper.addAttachment("mybrothermage.jpg", file);//image will be sent by this name

But in the output inline file position is right.. But I am getting 2 attchments.. One with NoName.jpg and another with mybrotherimage.jpg ?

Is it possible to send both inline files and attachemnts at the same time. If yes.. How can I make only attached files are in the output?


问:
Issue with pyobjc on macOS runner in GitHub workflow
first time posting on here so hopefully this is not an obvious question that I should be able to solve by myself (apologies if so!). I have a workflow (see below) for a GitHub Action which ran ok last week, and the exact same workflow (and code in the repository) now fails. The workflow installs python dependencies via poetry (before performing other actions), and fails with the following error in the dependency installation step, typically when the workflow is trying to install the requests or pytoolconfig packages:

ERROR: pyobjc_framework_FSEvents-8.5-cp36-abi3-macosx_11_0_universal2.whl is not a supported wheel on this platform.

Tried this both on macOS 11 and macOS12, and receive the same error. What's confusing me is that this was all working last week, and without any changes to the poetry lock file (or any of the python code), this now fails. Just for reference, the workflow runs ok on Ubuntu (it doesn't run on Windows, but that's due to some issues with Fiona and geopandas, unrelated to this question).

Any idea on why this may be happening?

Here's the workflow file:

```<code>name: mac-os-test

on: [push]

jobs:
  test:
    runs-on: macos-11
    timeout-minutes: 30
    steps:
        #----------------------------------------------
      #       check-out repo and set-up python
      #----------------------------------------------
      - name: Check out repository
        uses: actions/checkout@v3
      - name: Set up python
        id: setup-python
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'
      #----------------------------------------------
      #  -----  install & configure poetry  -----
      #----------------------------------------------
      - name: Install Poetry
        uses: snok/install-poetry@v1

      #----------------------------------------------
      #       load cached venv if cache exists
      #----------------------------------------------
      - name: Load cached venv
        id: cached-poetry-dependencies
        uses: actions/cache@v3
        with:
          path: .venv
          key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
      #----------------------------------------------
      # install dependencies if cache does not exist
      #----------------------------------------------
      - name: Install dependencies
        if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
        run: poetry install --no-interaction --no-root
      #----------------------------------------------
      # install your root project, if required
      #----------------------------------------------
      - name: Install project
        run: poetry install --no-interaction
      #----------------------------------------------
      #              run test suite
      #----------------------------------------------
      - name: Run tests
        run: poetry run pytest

</code>```

EDIT: should have added: the python package and poetry lock files were all developed on a macOS computer, and it all installs fine there too.

Body:
first time posting on here so hopefully this is not an obvious question that I should be able to solve by myself (apologies if so!). I have a workflow (see below) for a GitHub Action which ran ok last week, and the exact same workflow (and code in the repository) now fails. The workflow installs python dependencies via poetry (before performing other actions), and fails with the following error in the dependency installation step, typically when the workflow is trying to install the requests or pytoolconfig packages:

ERROR: pyobjc_framework_FSEvents-8.5-cp36-abi3-macosx_11_0_universal2.whl is not a supported wheel on this platform.

Tried this both on macOS 11 and macOS12, and receive the same error. What's confusing me is that this was all working last week, and without any changes to the poetry lock file (or any of the python code), this now fails. Just for reference, the workflow runs ok on Ubuntu (it doesn't run on Windows, but that's due to some issues with Fiona and geopandas, unrelated to this question).

Any idea on why this may be happening?

Here's the workflow file:

name: mac-os-test

on: [push]

jobs:
  test:
    runs-on: macos-11
    timeout-minutes: 30
    steps:
        #----------------------------------------------
      #       check-out repo and set-up python
      #----------------------------------------------
      - name: Check out repository
        uses: actions/checkout@v3
      - name: Set up python
        id: setup-python
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'
      #----------------------------------------------
      #  -----  install & configure poetry  -----
      #----------------------------------------------
      - name: Install Poetry
        uses: snok/install-poetry@v1

      #----------------------------------------------
      #       load cached venv if cache exists
      #----------------------------------------------
      - name: Load cached venv
        id: cached-poetry-dependencies
        uses: actions/cache@v3
        with:
          path: .venv
          key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
      #----------------------------------------------
      # install dependencies if cache does not exist
      #----------------------------------------------
      - name: Install dependencies
        if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
        run: poetry install --no-interaction --no-root
      #----------------------------------------------
      # install your root project, if required
      #----------------------------------------------
      - name: Install project
        run: poetry install --no-interaction
      #----------------------------------------------
      #              run test suite
      #----------------------------------------------
      - name: Run tests
        run: poetry run pytest

EDIT: should have added: the python package and poetry lock files were all developed on a macOS computer, and it all installs fine there too.


问:
In rabbitmq message from a named queue is displayed as always ready, how can I delete a message from there after it is read by another queue?
In rabbitmq message from a named queue is displayed as ready and it is ackowledged by another queue which has topic exchange.

In the following image I have 2 different queues, one named one generated randomly by rabbtmq:

I know that I send one message from the named queue (6.30189.facility_status) which has topic exchange and a specific routing key. In the consumer I create a queue without giving it a specific name, in the picture is the second queue (amq.gen-....). The consumer has a topic exchange and can get message from many queues.

How can I delete the messaged which is read from the named queue after I consume it in the second queue?


问:
Junit integration tests with file realm authentication
Recently I changed authorization in my REST API from jwt to file-realm, and here comes problem. My IT test just stopped working. I was looking for solution but cant find anything. If anyone can help me fix it i will be grateful. Im using @DeclareRoles({"admin", "user"}) in me "extends" application class and @RolesAllowed on all my endpoint. How shoudl i implement it to intergration tests with junit and arquillian?</p>


问:
Fuse.js - search through nested values
I use fuse.js with useExtendedSearch enabled. I have an array of objects. Each of the objects has a key of type array that contains objects.

I want to search for values in both the outer array and the inner array. It works if the search keyword is in the outer array. But it does not work, if the inner array contains the search keyword.

In the code below, I want to filter the countries such that it contains only the object  whose name is exactly as the search keyword.

const data = [{
    "continent": "Asia",
    countries: [{
        name: "Korea"
      },
      {
        name: "Japan"
      },
      {
        name: "China"
      },
      {
        name: "Pakistan"
      },
    ]
  },
  {
    "continent": "Europe",
    countries: [{
        name: "Albania"
      },
      {
        name: "France"
      },
      {
        name: "England"
      },
      {
        name: "Spain"
      },
    ]
  },
  {
    "continent": "Africa",
    countries: [{
        name: "Algeria"
      },
      {
        name: "Angola"
      },
      {
        name: "Benin"
      },
      {
        name: "South Africa"
      },
    ]
  }
]

const options = {
  useExtendedSearch: true,
  keys: [
    "continent",
    "countries.name"
  ]
};

const fuse = new Fuse(data, options);

// Change the pattern
const pattern = "=Pakistan"

console.log(fuse.search(pattern))```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdn.jsdelivr.net/npm/fuse.js@6.6.2"></script></code>```

But it only filters the outer array.

```<code>[{
  "continent": "Asia",
  countries: [{
      name: "Korea"
    },
    {
      name: "Japan"
    },
    {
      name: "China"
    },
    {
      name: "Pakistan"
    },
  ]
}]

</code>```

I expect it to retun:

```<code> [{
  "continent": "Asia",
  countries: [{
    name: "Pakistan"
  }]
}]

</code>```

Is  it possible to achive this in Fuse.js?

Title: Fuse.js - search through nested values

Body:
I use fuse.js with useExtendedSearch enabled. I have an array of objects. Each of the objects has a key of type array that contains objects.

I want to search for values in both the outer array and the inner array. It works if the search keyword is in the outer array. But it does not work, if the inner array contains the search keyword.

In the code below, I want to filter the countries such that it contains only the object  whose name is exactly as the search keyword.

const data = [{
    "continent": "Asia",
    countries: [{
        name: "Korea"
      },
      {
        name: "Japan"
      },
      {
        name: "China"
      },
      {
        name: "Pakistan"
      },
    ]
  },
  {
    "continent": "Europe",
    countries: [{
        name: "Albania"
      },
      {
        name: "France"
      },
      {
        name: "England"
      },
      {
        name: "Spain"
      },
    ]
  },
  {
    "continent": "Africa",
    countries: [{
        name: "Algeria"
      },
      {
        name: "Angola"
      },
      {
        name: "Benin"
      },
      {
        name: "South Africa"
      },
    ]
  }
]

const options = {
  useExtendedSearch: true,
  keys: [
    "continent",
    "countries.name"
  ]
};

const fuse = new Fuse(data, options);

// Change the pattern
const pattern = "=Pakistan"

console.log(fuse.search(pattern))

But it only filters the outer array.

[{
  "continent": "Asia",
  countries: [{
      name: "Korea"
    },
    {
      name: "Japan"
    },
    {
      name: "China"
    },
    {
      name: "Pakistan"
    },
  ]
}]

I expect it to retun:

 [{
  "continent": "Asia",
  countries: [{
    name: "Pakistan"
  }]
}]

Is  it possible to achive this in Fuse.js?


问:
Detect when a screenshot was taken without requiring storage permission on Android
I want to know when a screenshot has been taken of our application, but I do not care about the metadata, nor do I want a reference to the actual image.

The current implementation I'm looking to improve declares a custom ContentObserver, which subscribes to MediaStore.Images.Media.EXTERNAL_CONTENT_URI

```<code>mContentResolver.registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true, this)
</code>```

This enables the Observer to be notified when content has changed in this URI.

```<code>@Override
synchronized public void onChange(boolean selfChange, Uri uri) {
    super.onChange(selfChange, uri);
    if (uri.toString().startsWith(MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString())) {
        try {
            checkPermissionAndProcess(uri);
        } catch (Exception e) {
            Timber.w(e, "onChange error : %s", e.toString());
        }
    } else {
        Timber.v("[Finish] not EXTERNAL_CONTENT_URI ");
    }
}
</code>```

At this point, we need to check if we have Manifest.permission.READ_EXTERNAL_STORAGE and if not, request it. If the user grants us this permission, we can verify if the URI change is a screenshot with a series of checks. If we don't have permission, a SecurityException is thrown.

```<code>private boolean matchPath(String path) {
    return (path.toLowerCase().contains("screenshots/") && !path.contains(FILE_POSTFIX));
}
</code>```

My understanding of a ContentResolver observing MediaStore.Images.Media.EXTERNAL_CONTENT_URI means that any changes external to the application's storage can invoke the onChange callback.

Is there any way around this without asking the user for storage access which feels icky?

On Android 7.1.1 and Android 13 devices, I have tried using the camera while the app is in the background to trigger the onChange of the ContentResolver, and I only see it invoked when I take a screenshot. Assuming just observing changes in MediaStore.Images.Media.EXTERNAL_CONTENT_URI is naive, as other apps storing images could also result in changes here.

Body:
I want to know when a screenshot has been taken of our application, but I do not care about the metadata, nor do I want a reference to the actual image.

The current implementation I'm looking to improve declares a custom ContentObserver, which subscribes to MediaStore.Images.Media.EXTERNAL_CONTENT_URI

mContentResolver.registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true, this)

This enables the Observer to be notified when content has changed in this URI.

@Override
synchronized public void onChange(boolean selfChange, Uri uri) {
    super.onChange(selfChange, uri);
    if (uri.toString().startsWith(MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString())) {
        try {
            checkPermissionAndProcess(uri);
        } catch (Exception e) {
            Timber.w(e, "onChange error : %s", e.toString());
        }
    } else {
        Timber.v("[Finish] not EXTERNAL_CONTENT_URI ");
    }
}

At this point, we need to check if we have Manifest.permission.READ_EXTERNAL_STORAGE and if not, request it. If the user grants us this permission, we can verify if the URI change is a screenshot with a series of checks. If we don't have permission, a SecurityException is thrown.

private boolean matchPath(String path) {
    return (path.toLowerCase().contains("screenshots/") && !path.contains(FILE_POSTFIX));
}

My understanding of a ContentResolver observing MediaStore.Images.Media.EXTERNAL_CONTENT_URI means that any changes external to the application's storage can invoke the onChange callback.

Is there any way around this without asking the user for storage access which feels icky?

On Android 7.1.1 and Android 13 devices, I have tried using the camera while the app is in the background to trigger the onChange of the ContentResolver, and I only see it invoked when I take a screenshot. Assuming just observing changes in MediaStore.Images.Media.EXTERNAL_CONTENT_URI is naive, as other apps storing images could also result in changes here.


问:
Urlopen can't decode bytes
My code is very simple:

```<code>from urllib.request import urlopen

quest = input("question link: ").strip()
page = urlopen(quest).read().decode()
</code>```

I want the user to input an url and to store the raw data of it, in page, but when I try to run it with an url like this https://stackoverflow.com/questions/74783398/pyqt-app-doesnt-exit-when-i-close-the-window it returns to me an error saying that it couldn't decode a byte:

```<code>Traceback (most recent call last):
  File "C:\Users\Student\sofCheck.py", line 14, in <module>
    if search(page, "<body class=\"question-page"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 176, in search
    return _compile(pattern, flags).search(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_compiler.py", line 743, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 980, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 863, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 612, in _parse
    raise source.error(msg, len(this) + 1 + len(that))
re.error: bad character range t-p at position 20988 (line 328, column 219)
</code>```

How can I fix it?
Thanks.

Title: Urlopen can't decode bytes

Body:
My code is very simple:

from urllib.request import urlopen

quest = input("question link: ").strip()
page = urlopen(quest).read().decode()

I want the user to input an url and to store the raw data of it, in page, but when I try to run it with an url like this https://stackoverflow.com/questions/74783398/pyqt-app-doesnt-exit-when-i-close-the-window it returns to me an error saying that it couldn't decode a byte:

Traceback (most recent call last):
  File "C:\Users\Student\sofCheck.py", line 14, in <module>
    if search(page, "<body class=\"question-page"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 176, in search
    return _compile(pattern, flags).search(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_compiler.py", line 743, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 980, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 863, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 455, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Student\AppData\Local\Programs\Python\Python311\Lib\re\_parser.py", line 612, in _parse
    raise source.error(msg, len(this) + 1 + len(that))
re.error: bad character range t-p at position 20988 (line 328, column 219)

How can I fix it?
Thanks.


问:
Adding up results from for loop + auto break when number in let is reached
I am working on an algoritm that outputs random data for an upcoming movie project I am working on.

I have an RNG called ShotRNG that outputs a number between 1 and 72 (which stands for the length of each shot in frames based on 24 frames per second)

Let's say I have a usableRunTime let which defines the total usable time.

In this case, usableRunTime = 500

I want a for loop to run and add all of the results from the shotRNG together. Once the total numbers generated by usableRunTime reaches 500 or above, I want the for loop to automatically break.

Can someone help me with this?

I've tried for and while loops but I haven't been able to get it to work yet. Some of my code is underneath:

`

```<code>function partSixDivider(){
    console.log ("#006\tPOST PRODUCTION\n[DETERMINES ENTIRE FLOW OF THE FILM BASED UPON THE PREVIOUSLY GENERATED PARAMETERS]\n\n");
}

let usableRunTime = 0;

function convertSecondsToFramesDeclaration() {
    usableRunTime = totalRunTime * 24 - 360;
    return "TOTAL USABLE FRAMES (BASED ON 24FPS):\t" + usableRunTime;
}

function shotRNG() {
    return Math.floor(Math.random() * (totalShotSum - 1 + 1)) + 1;
}

function frameRNG() {
    return Math.floor(Math.random() * (72 - 1 + 1)) + 1;
}

function shotVersion() {
    let versionRNG = shotParameterCalculation(1,4)
    return versionRNG;
}

let introFrames = 240; // Based on 10 seconds * 24 frames per second
let outtroFrames = 120; // Based on 5 seconds * 24 frames per second

function filmDeclaration() {
    console.log("FILM OVERVIEW REPORT\n\n");
    console.log("INTRO \tVERSION: N/A\tFRAMES: "+ introFrames)

    for (let x = 1; x <= usableRunTime; x++) {
        console.log("SHOT " + shotRNG() + ":\t" + "VERSION: " +shotVersion()) + "\t" + "FRAMES:"
    }

    console.log("OUTTRO \tVERSION: N/A\tFRAMES: "+ outtroFrames) +"\n\n"
}
</code>```

`

Body:
I am working on an algoritm that outputs random data for an upcoming movie project I am working on.

I have an RNG called ShotRNG that outputs a number between 1 and 72 (which stands for the length of each shot in frames based on 24 frames per second)

Let's say I have a usableRunTime let which defines the total usable time.

In this case, usableRunTime = 500

I want a for loop to run and add all of the results from the shotRNG together. Once the total numbers generated by usableRunTime reaches 500 or above, I want the for loop to automatically break.

Can someone help me with this?

I've tried for and while loops but I haven't been able to get it to work yet. Some of my code is underneath:

`

function partSixDivider(){
    console.log ("#006\tPOST PRODUCTION\n[DETERMINES ENTIRE FLOW OF THE FILM BASED UPON THE PREVIOUSLY GENERATED PARAMETERS]\n\n");
}

let usableRunTime = 0;

function convertSecondsToFramesDeclaration() {
    usableRunTime = totalRunTime * 24 - 360;
    return "TOTAL USABLE FRAMES (BASED ON 24FPS):\t" + usableRunTime;
}

function shotRNG() {
    return Math.floor(Math.random() * (totalShotSum - 1 + 1)) + 1;
}

function frameRNG() {
    return Math.floor(Math.random() * (72 - 1 + 1)) + 1;
}

function shotVersion() {
    let versionRNG = shotParameterCalculation(1,4)
    return versionRNG;
}

let introFrames = 240; // Based on 10 seconds * 24 frames per second
let outtroFrames = 120; // Based on 5 seconds * 24 frames per second

function filmDeclaration() {
    console.log("FILM OVERVIEW REPORT\n\n");
    console.log("INTRO \tVERSION: N/A\tFRAMES: "+ introFrames)

    for (let x = 1; x <= usableRunTime; x++) {
        console.log("SHOT " + shotRNG() + ":\t" + "VERSION: " +shotVersion()) + "\t" + "FRAMES:"
    }

    console.log("OUTTRO \tVERSION: N/A\tFRAMES: "+ outtroFrames) +"\n\n"
}

`


问:
Need help in speeding up a looping macro
I am using a Macro to identify same details entered (in Column B, C and D) for multiple students (Column A).
This macro is working fine on approx 10,000 rows. But when I use it on full database ex: 1,00,000 rows it just got hanged.

Any help to in speeding up this macro will be very helpful.

`

```<code>Option Explicit
Sub test()
  Dim lRow As Long, i As Long, j As Long
  Dim c As Integer
  Dim students() As Variant
  Dim results() As Variant

  lRow = Cells(Rows.Count, 1).End(xlUp).Row
  ReDim results(lRow - 1)
  students = Range("A1:D" & lRow).Value

  For i = 2 To lRow
    found = False
    For j = 2 To lRow
      If students(i, 1) = students(j, 1) Then GoTo skipStudent
      For c = 1 To 4
        If students(j, c) = "-" Or students(i, c) = "-" Then GoTo skipColumn
        If students(i, c) = students(j, c) Then
          results(i - 1) = results(i - 1) & "Same " & students(1, c) & " information with " & students(j, 1) & vbCrLf
        End If
skipColumn:
        Next
skipStudent:
    Next
  Next

  Application.ScreenUpdating = False
  For i = 2 To lRow
    Cells(i, 5).Value = results(i - 1)
  Next
  Application.ScreenUpdating = True

End Sub
</code>```

`

Body:
I am using a Macro to identify same details entered (in Column B, C and D) for multiple students (Column A).
This macro is working fine on approx 10,000 rows. But when I use it on full database ex: 1,00,000 rows it just got hanged.

Any help to in speeding up this macro will be very helpful.

`

Option Explicit
Sub test()
  Dim lRow As Long, i As Long, j As Long
  Dim c As Integer
  Dim students() As Variant
  Dim results() As Variant

  lRow = Cells(Rows.Count, 1).End(xlUp).Row
  ReDim results(lRow - 1)
  students = Range("A1:D" & lRow).Value

  For i = 2 To lRow
    found = False
    For j = 2 To lRow
      If students(i, 1) = students(j, 1) Then GoTo skipStudent
      For c = 1 To 4
        If students(j, c) = "-" Or students(i, c) = "-" Then GoTo skipColumn
        If students(i, c) = students(j, c) Then
          results(i - 1) = results(i - 1) & "Same " & students(1, c) & " information with " & students(j, 1) & vbCrLf
        End If
skipColumn:
        Next
skipStudent:
    Next
  Next

  Application.ScreenUpdating = False
  For i = 2 To lRow
    Cells(i, 5).Value = results(i - 1)
  Next
  Application.ScreenUpdating = True

End Sub

`


问:
Json issue in Cloudformation for glue workflow
I have created below cloudformation yaml for glue workflow.
Parameter GlWFproperties defined as type string

```<code>Type: AWS::Glue::Workflow
Properties:
  DefaultRunProperties: !Ref GlWFproperties
  Description: !Ref GlWFdescription
  MaxConcurrentRuns: !Ref GlWFMaxConcurrentRuns
  Name: !Ref GlWFname
</code>```

I am passing the parameters to this template while deploying it.

If i deploy this template without DefaultRunProperties it works.But when i pass values to "DefaultRunProperties" it fails with error "Internal Failure".

DefaultRunProperties is defined as Type JSON in aws documentation.

Values i am passing to this is as

```<code>{ "sql": "inno", "format": "aro"}
</code>```

also tried

```<code>"{ \"sql\": \"inno\", \"format\": \"aro\"}"
</code>```

Body:
I have created below cloudformation yaml for glue workflow.
Parameter GlWFproperties defined as type string

Type: AWS::Glue::Workflow
Properties:
  DefaultRunProperties: !Ref GlWFproperties
  Description: !Ref GlWFdescription
  MaxConcurrentRuns: !Ref GlWFMaxConcurrentRuns
  Name: !Ref GlWFname

I am passing the parameters to this template while deploying it.

If i deploy this template without DefaultRunProperties it works.But when i pass values to "DefaultRunProperties" it fails with error "Internal Failure".

DefaultRunProperties is defined as Type JSON in aws documentation.

Values i am passing to this is as

{ "sql": "inno", "format": "aro"}

also tried

"{ \"sql\": \"inno\", \"format\": \"aro\"}"


问:
datadog monitering - create a metric that always returns a fixed value
In our application we are using datadog for monitoring, we are tracking the memory usage and sending the alert notinification to a slack channel. the monitoring config file is as below, i have added the formula for the numerator_metric. but for the demominator_metric, the value should be 1700, but i cant add the value directly over there instead i need to create a metric that always returns 1700,</p>
```<code>{
    "type": "metric_ratio",
    "comparison": ">",
    "numerator_metric": "aws.lambda.enhanced.max_memory_used{functionname:sample-function}",
    "denominator_metric": "",
    "warning_threshold": 70,
    "target_threshold": 75,
    "description": "Increased memory usage [prod]",
    "monitor_timeframe": "1h",
    "slo_timeframe": "7d",
    "name": "Memory Usage",
    "notify":[
        { "platform": "slack", "reference": "slack-channel" }
    ]
}
</code>```

Body:
In our application we are using datadog for monitoring, we are tracking the memory usage and sending the alert notinification to a slack channel. the monitoring config file is as below, i have added the formula for the numerator_metric. but for the demominator_metric, the value should be 1700, but i cant add the value directly over there instead i need to create a metric that always returns 1700,

{
    "type": "metric_ratio",
    "comparison": ">",
    "numerator_metric": "aws.lambda.enhanced.max_memory_used{functionname:sample-function}",
    "denominator_metric": "",
    "warning_threshold": 70,
    "target_threshold": 75,
    "description": "Increased memory usage [prod]",
    "monitor_timeframe": "1h",
    "slo_timeframe": "7d",
    "name": "Memory Usage",
    "notify":[
        { "platform": "slack", "reference": "slack-channel" }
    ]
}


问:
Logstash - sequential loading of data from different sources
Please tell me, if I have an input section in logstash, where I read data from two different sources, then how can I make the data read in order: first, the data from source-1 is loaded, and only after they are loaded, the data is loaded from source-2

```<code>input {
   jdbc {
      #настройки для источника-1
   }

   jdbc {
      #настройки для источника-2
   }
}
</code>```

now the data is read at the same time.

I tried to set this config for pipeline in pipelines.yml

```<code>pipeline.workers: 1
pipeline.ordered: true
</code>```

but this does not help, the data is still read at the same time.

Body:
Please tell me, if I have an input section in logstash, where I read data from two different sources, then how can I make the data read in order: first, the data from source-1 is loaded, and only after they are loaded, the data is loaded from source-2

input {
   jdbc {
      #настройки для источника-1
   }

   jdbc {
      #настройки для источника-2
   }
}

now the data is read at the same time.

I tried to set this config for pipeline in pipelines.yml

pipeline.workers: 1
pipeline.ordered: true

but this does not help, the data is still read at the same time.