问:
Csplit invalid pattern
I have to check the access-lists in over 200 devices then compare the new and old access-lists. I used Cisco Mass Configurator to get me the access-lists so I don't have to log in to each devices. I want to split the result (from Cisco Mass Configurator) so it will only show me the access-lists of each device without other sentences. Below is just an example of the result. The actual result is way longer than this.

```<code>Getting NetBox devices and writing summary files ... Time: 17.27 secs

Rendering config for devices ... Time: 0.01 secs

Generating testbed using NetBox data ... Time: 0.00 secs

!!!-------------------- WARNING --------------------!!! You are about to configure the following:
========================================= do more abcconfig.old | s ip access-list extended TEST do more abcconfig.old | s ip access-list extended TRY
========================================= Please check output/device_configurations.txt for the rendered configuration for each device. Do you really want to automatically configure the 4 devices listed in the output/device_list.txt file? Automatic saving: disabled Configuration of unsaved config: enabled Continue? [y/n]

Device: 1/4 | abcatlinr1

2022-12-12 13:00:53,762: %UNICON-INFO: +++ Unicon plugin iosxe (unicon.plugins.iosxe) +++ Warning: Permanently added '50.50.50.50' (RSA) to the list of known hosts.

2022-12-12 13:00:53,950: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.50 -p 22, id: 123456789101112 +++

2022-12-12 13:00:53,952: %UNICON-INFO: connection to abcatlinr1

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:  abcatlinr1#

2022-12-12 13:00:54,505: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:00:54,578: %UNICON-INFO: +++ abcatlinr1 with via 'cli': executing command 'term length 0' +++ term length 0 abcatlinr1#

2022-12-12 13:00:55,118: %UNICON-INFO: +++ abcatlinr1 with via 'cli': executing command 'term width 0' +++ term width 0 abcatlinr1#

2022-12-12 13:00:55,560: %UNICON-INFO: +++ abcatlinr1 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TEST
ip access-list extended TEST
 10 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 20 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 30 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 40 permit ip object-group BBB-MON object-group AAA-MON
 50 permit ip 10.10.10.0 0.0.0.31 172.16.1.0 0.0.0.255
 440 deny   ip any any
abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 10 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 15 permit object-group WARP-ports object-group LOCAL-LAN object-group WARP-extern
 26 permit tcp host 172.16.2.0 any eq 443
 30 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 40 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 100 deny   ip any any

Device: 2/4 | abcbezanr1

2022-12-12 13:00:56,218: %UNICON-INFO: +++ Unicon plugin ios (unicon.plugins.ios) +++ Warning: Permanently added '50.50.50.60' (RSA) to the list of known hosts.

2022-12-12 13:00:57,743: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.60 -p 22, id: 345678910111213 +++

2022-12-12 13:00:57,743: %UNICON-INFO: connection to abcbezanr1

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:  abcbezanr1#

2022-12-12 13:00:58,463: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:00:58,532: %UNICON-INFO: +++ abcbezanr1 with via 'cli': executing command 'term length 0' +++ term length 0 abcbezanr1#

2022-12-12 13:00:59,032: %UNICON-INFO: +++ abcbezanr1 with via 'cli': executing command 'term width 0' +++ term width 0 abcbezanr1#

2022-12-12 13:00:59,527: %UNICON-INFO: +++ abcbezanr1 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit ip object-group BBB-MON object-group AAA-MON
 permit tcp 172.16.30.0 0.0.0.255 host 10.10.1.110 eq 443
 deny   ip any any log

Device: 3/4 | abcbrguar1

2022-12-12 13:01:00,400: %UNICON-INFO: +++ Unicon plugin ios (unicon.plugins.ios) +++ Warning: Permanently added '50.50.50.70' (RSA) to the list of known hosts.

2022-12-12 13:01:01,810: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.70 -p 22, id: 567891011121314 +++

2022-12-12 13:01:01,811: %UNICON-INFO: connection to abcbrguar1

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:

abcbrguar1#

2022-12-12 13:01:05,087: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:01:05,161: %UNICON-INFO: +++ abcbrguar1 with via 'cli': executing command 'term length 0' +++ term length 0 abcbrguar1#

2022-12-12 13:01:06,270: %UNICON-INFO: +++ abcbrguar1 with via 'cli': executing command 'term width 0' +++ term width 0 abcbrguar1#

2022-12-12 13:01:07,256: %UNICON-INFO: +++ abcbrguar1 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log

Device: 4/4 | abcbrguar2

2022-12-12 13:01:10,435: %UNICON-INFO: +++ Unicon plugin ios (unicon.plugins.ios) +++ Warning: Permanently added '50.50.50.80' (RSA) to the list of known hosts.

2022-12-12 13:01:11,891: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.80 -p 22, id: 789101112131415 +++

2022-12-12 13:01:11,892: %UNICON-INFO: connection to abcbrguar2

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:

abcbrguar2#

2022-12-12 13:01:15,086: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:01:15,156: %UNICON-INFO: +++ abcbrguar2 with via 'cli': executing command 'term length 0' +++ term length 0 abcbrguar2#

2022-12-12 13:01:16,146: %UNICON-INFO: +++ abcbrguar2 with via 'cli': executing command 'term width 0' +++ term width 0 abcbrguar2#

2022-12-12 13:01:17,138: %UNICON-INFO: +++ abcbrguar2 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit eigrp host 172.16.1.2 host 224.0.0.10
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log
</code>```

This is the result I want to get:

```<code>qwerty@servername:~/access-list$ cat xx000
abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TEST
ip access-list extended TEST
 10 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 20 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 30 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 40 permit ip object-group BBB-MON object-group AAA-MON
 50 permit ip 10.10.10.0 0.0.0.31 172.16.1.0 0.0.0.255
 440 deny   ip any any
abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 10 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 15 permit object-group WARP-ports object-group LOCAL-LAN object-group WARP-extern
 26 permit tcp host 172.16.2.0 any eq 443
 30 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 40 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 100 deny   ip any any

qwerty@servername:~/access-list$ cat xx001
abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit ip object-group BBB-MON object-group AAA-MON
 permit tcp 172.16.30.0 0.0.0.255 host 10.10.1.110 eq 443
 deny   ip any any log

qwerty@servername:~/access-list$ cat xx002
abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log

qwerty@servername:~/access-list$ cat xx003
abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit eigrp host 172.16.1.2 host 224.0.0.10
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log
</code>```

I'm doing it using MTPuTTY, saved the file as access-list.txt.

I notice that config term and Password is a pattern, so I tried to do the following:

```<code>csplit access-list.txt '\config term\'
csplit access-list.txt '\config\'
csplit access-list.txt '\config term.*\'
csplit access-list.txt '\.*config term.*\'
csplit access-list.txt '\Password:\'
csplit access-list.txt '\.*Password:.*\'
</code>```

but got an error csplit: \config term\: invalid pattern

When I checked the hexadecimal using hexdump -C access-list.txt I got the hexadecimal result, so there's no error on text itself.

Could anyone please help me with this? Thank you! :)

Title: Csplit invalid pattern

Body:
I have to check the access-lists in over 200 devices then compare the new and old access-lists. I used Cisco Mass Configurator to get me the access-lists so I don't have to log in to each devices. I want to split the result (from Cisco Mass Configurator) so it will only show me the access-lists of each device without other sentences. Below is just an example of the result. The actual result is way longer than this.

Getting NetBox devices and writing summary files ... Time: 17.27 secs

Rendering config for devices ... Time: 0.01 secs

Generating testbed using NetBox data ... Time: 0.00 secs

!!!-------------------- WARNING --------------------!!! You are about to configure the following:
========================================= do more abcconfig.old | s ip access-list extended TEST do more abcconfig.old | s ip access-list extended TRY
========================================= Please check output/device_configurations.txt for the rendered configuration for each device. Do you really want to automatically configure the 4 devices listed in the output/device_list.txt file? Automatic saving: disabled Configuration of unsaved config: enabled Continue? [y/n]

Device: 1/4 | abcatlinr1

2022-12-12 13:00:53,762: %UNICON-INFO: +++ Unicon plugin iosxe (unicon.plugins.iosxe) +++ Warning: Permanently added '50.50.50.50' (RSA) to the list of known hosts.

2022-12-12 13:00:53,950: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.50 -p 22, id: 123456789101112 +++

2022-12-12 13:00:53,952: %UNICON-INFO: connection to abcatlinr1

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:  abcatlinr1#

2022-12-12 13:00:54,505: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:00:54,578: %UNICON-INFO: +++ abcatlinr1 with via 'cli': executing command 'term length 0' +++ term length 0 abcatlinr1#

2022-12-12 13:00:55,118: %UNICON-INFO: +++ abcatlinr1 with via 'cli': executing command 'term width 0' +++ term width 0 abcatlinr1#

2022-12-12 13:00:55,560: %UNICON-INFO: +++ abcatlinr1 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TEST
ip access-list extended TEST
 10 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 20 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 30 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 40 permit ip object-group BBB-MON object-group AAA-MON
 50 permit ip 10.10.10.0 0.0.0.31 172.16.1.0 0.0.0.255
 440 deny   ip any any
abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 10 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 15 permit object-group WARP-ports object-group LOCAL-LAN object-group WARP-extern
 26 permit tcp host 172.16.2.0 any eq 443
 30 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 40 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 100 deny   ip any any

Device: 2/4 | abcbezanr1

2022-12-12 13:00:56,218: %UNICON-INFO: +++ Unicon plugin ios (unicon.plugins.ios) +++ Warning: Permanently added '50.50.50.60' (RSA) to the list of known hosts.

2022-12-12 13:00:57,743: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.60 -p 22, id: 345678910111213 +++

2022-12-12 13:00:57,743: %UNICON-INFO: connection to abcbezanr1

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:  abcbezanr1#

2022-12-12 13:00:58,463: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:00:58,532: %UNICON-INFO: +++ abcbezanr1 with via 'cli': executing command 'term length 0' +++ term length 0 abcbezanr1#

2022-12-12 13:00:59,032: %UNICON-INFO: +++ abcbezanr1 with via 'cli': executing command 'term width 0' +++ term width 0 abcbezanr1#

2022-12-12 13:00:59,527: %UNICON-INFO: +++ abcbezanr1 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit ip object-group BBB-MON object-group AAA-MON
 permit tcp 172.16.30.0 0.0.0.255 host 10.10.1.110 eq 443
 deny   ip any any log

Device: 3/4 | abcbrguar1

2022-12-12 13:01:00,400: %UNICON-INFO: +++ Unicon plugin ios (unicon.plugins.ios) +++ Warning: Permanently added '50.50.50.70' (RSA) to the list of known hosts.

2022-12-12 13:01:01,810: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.70 -p 22, id: 567891011121314 +++

2022-12-12 13:01:01,811: %UNICON-INFO: connection to abcbrguar1

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:

abcbrguar1#

2022-12-12 13:01:05,087: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:01:05,161: %UNICON-INFO: +++ abcbrguar1 with via 'cli': executing command 'term length 0' +++ term length 0 abcbrguar1#

2022-12-12 13:01:06,270: %UNICON-INFO: +++ abcbrguar1 with via 'cli': executing command 'term width 0' +++ term width 0 abcbrguar1#

2022-12-12 13:01:07,256: %UNICON-INFO: +++ abcbrguar1 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log

Device: 4/4 | abcbrguar2

2022-12-12 13:01:10,435: %UNICON-INFO: +++ Unicon plugin ios (unicon.plugins.ios) +++ Warning: Permanently added '50.50.50.80' (RSA) to the list of known hosts.

2022-12-12 13:01:11,891: %UNICON-INFO: +++ connection to spawn: ssh -l qwerty 50.50.50.80 -p 22, id: 789101112131415 +++

2022-12-12 13:01:11,892: %UNICON-INFO: connection to abcbrguar2

################### Authorised access only #################
#---------This system is the property of abc----------#
#-Disconnect IMMEDIATELY if you are not an authorised user-#
#-----Contact soc@abc.com +12-345-489101 for help-----#
############################################################ Password:

abcbrguar2#

2022-12-12 13:01:15,086: %UNICON-INFO: +++ initializing handle +++

2022-12-12 13:01:15,156: %UNICON-INFO: +++ abcbrguar2 with via 'cli': executing command 'term length 0' +++ term length 0 abcbrguar2#

2022-12-12 13:01:16,146: %UNICON-INFO: +++ abcbrguar2 with via 'cli': executing command 'term width 0' +++ term width 0 abcbrguar2#

2022-12-12 13:01:17,138: %UNICON-INFO: +++ abcbrguar2 with via 'cli': configure +++ config term Enter configuration commands, one per line.  End with CNTL/Z.

abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit eigrp host 172.16.1.2 host 224.0.0.10
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log

This is the result I want to get:

qwerty@servername:~/access-list$ cat xx000
abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TEST
ip access-list extended TEST
 10 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 20 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 30 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 40 permit ip object-group BBB-MON object-group AAA-MON
 50 permit ip 10.10.10.0 0.0.0.31 172.16.1.0 0.0.0.255
 440 deny   ip any any
abcatlinr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 10 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 15 permit object-group WARP-ports object-group LOCAL-LAN object-group WARP-extern
 26 permit tcp host 172.16.2.0 any eq 443
 30 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 40 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 100 deny   ip any any

qwerty@servername:~/access-list$ cat xx001
abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbezanr1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit ip object-group BBB-MON object-group AAA-MON
 permit tcp 172.16.30.0 0.0.0.255 host 10.10.1.110 eq 443
 deny   ip any any log

qwerty@servername:~/access-list$ cat xx002
abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar1(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-SERVER log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log

qwerty@servername:~/access-list$ cat xx003
abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TEST
abcbrguar2(config)#do more abcconfig.old | s ip access-list extended TRY
ip access-list extended TRY
 permit object-group Zscaler-ports object-group LOCAL-LAN object-group Zscaler-extern
 permit object-group MSTeams-udp object-group LOCAL-LAN object-group MSTeams-ranges-udp log
 permit object-group MSTeams-tcp object-group LOCAL-LAN object-group MSTeams-ranges-tcp log
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-VOICE-SERVER
 permit object-group AAA-VOICE-CLIENT-PORTS object-group LOCAL-LAN object-group AAA-VOICE-CLIENT
 permit ip object-group BBB-MON object-group AAA-MON
 permit object-group AAA-SERVER-PORTS object-group LOCAL-LAN object-group AAA-USWA-SERVER
 permit eigrp host 172.16.1.2 host 224.0.0.10
 permit ip 172.16.1.0 0.0.0.255 172.16.1.0 0.0.0.255
 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255
 deny   ip any any log

I'm doing it using MTPuTTY, saved the file as access-list.txt.

I notice that config term and Password is a pattern, so I tried to do the following:

csplit access-list.txt '\config term\'
csplit access-list.txt '\config\'
csplit access-list.txt '\config term.*\'
csplit access-list.txt '\.*config term.*\'
csplit access-list.txt '\Password:\'
csplit access-list.txt '\.*Password:.*\'

but got an error csplit: \config term\: invalid pattern

When I checked the hexadecimal using hexdump -C access-list.txt I got the hexadecimal result, so there's no error on text itself.

Could anyone please help me with this? Thank you! :)


来源: stackexchange

问:
Compose nestedScrollConnection not being triggered with animated scroll
I've created a collapsible header in Compose with the NestedScrollConnection. Everything works perfectly but one addition had to be made: automatic scrolling to a certain item. The problem I have is that the header (connected using the NestedScrollConnection) does not update when triggering an animateScrollTo.

Found a similar version from the Android developer docs here (this is from the experimental Material3 library, but it also happens without):

```<code>val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
Scaffold(
    modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
    topBar = {
        MediumTopAppBar(
            title = { Text("Medium TopAppBar") },
            navigationIcon = {
                Icon(imageVector = Icons.Filled.Menu, contentDescription = "Localized description")
            },
            scrollBehavior = scrollBehavior
        )
    },
    content = { innerPadding ->
        val listState = rememberLazyListState()

        val coroutines = rememberCoroutineScope()
        LaunchedEffect(key1 = Unit, block = {
            coroutines.launch {
                delay(5000)
                // Starts the scrollTo
                listState.animateScrollToItem(50, 0)
            }
        })

        LazyColumn(
            state = listState,
            contentPadding = innerPadding,
            verticalArrangement = Arrangement.spacedBy(8.dp)
        ) {
            val list = (0..75).map { it.toString() }
            items(count = list.size) {
                Text(
                    text = list[it],
                    modifier = Modifier.fillMaxWidth()
                )
            }
        }
    }
)
</code>```

Even though scrolling to an item works and the item is visible the header did not update at all.

When looking to the documentation of the LazyListState animateScrollToItem it does not say anything about skipping nested scroll connections (like dispatchRawDelta does). Even with the linked example above the scrollTo item does not update the header state. The problem also occurs with a normal scrollable Column, LazyGrid etc.

I did think of other ways of fixing it:

Getting the amount of pixels scrolled and dispatch it to the nestedScrollConnection but there is no reliable way of getting the scrolled pixels from a LazyColumn

Measuring all items and passing that but when items would invalidate this will fail

I get the feeling that a part of this connection is missing. Does anyone have any ideas?

ContentLicense: CC BY-SA 4.0

Body:
I've created a collapsible header in Compose with the NestedScrollConnection. Everything works perfectly but one addition had to be made: automatic scrolling to a certain item. The problem I have is that the header (connected using the NestedScrollConnection) does not update when triggering an animateScrollTo.

Found a similar version from the Android developer docs here (this is from the experimental Material3 library, but it also happens without):

val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
Scaffold(
    modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
    topBar = {
        MediumTopAppBar(
            title = { Text("Medium TopAppBar") },
            navigationIcon = {
                Icon(imageVector = Icons.Filled.Menu, contentDescription = "Localized description")
            },
            scrollBehavior = scrollBehavior
        )
    },
    content = { innerPadding ->
        val listState = rememberLazyListState()

        val coroutines = rememberCoroutineScope()
        LaunchedEffect(key1 = Unit, block = {
            coroutines.launch {
                delay(5000)
                // Starts the scrollTo
                listState.animateScrollToItem(50, 0)
            }
        })

        LazyColumn(
            state = listState,
            contentPadding = innerPadding,
            verticalArrangement = Arrangement.spacedBy(8.dp)
        ) {
            val list = (0..75).map { it.toString() }
            items(count = list.size) {
                Text(
                    text = list[it],
                    modifier = Modifier.fillMaxWidth()
                )
            }
        }
    }
)

Even though scrolling to an item works and the item is visible the header did not update at all.

When looking to the documentation of the LazyListState animateScrollToItem it does not say anything about skipping nested scroll connections (like dispatchRawDelta does). Even with the linked example above the scrollTo item does not update the header state. The problem also occurs with a normal scrollable Column, LazyGrid etc.

I did think of other ways of fixing it:

Getting the amount of pixels scrolled and dispatch it to the nestedScrollConnection but there is no reliable way of getting the scrolled pixels from a LazyColumn

Measuring all items and passing that but when items would invalidate this will fail

I get the feeling that a part of this connection is missing. Does anyone have any ideas?


问:
How can I integrate tkinterdnd2 into my existing tkinter window, without creating a new window
I am playing around with the functionality of tkinterdnd2. Hereby I created a Listbox for simple drag&drop action. I am looking for a solution to integrate tkinterdnd2 function drop_target_register, without replacing tk.Frame with TkinterDnD.Tk. How can I create a class instance of TkinterDnD, without creating a new window? Basically I just want give my listbox the drag&drop functionality.

```<code>class App(tk.Frame):
    def __init__(self):
        super().__init__()

        frame = tk.Frame(self)
        frame.pack(expand=tk.YES, fill=tk.BOTH)

        self.file_names_listbox = tk.Listbox(frame, selectmode=tk.SINGLE, background="darkgray", height=  100, width=100)
        self.file_names_listbox.pack()
        self.file_names_listbox.drop_target_register(DND_ALL)
        self.file_names_listbox.dnd_bind("<<Drop>>", self.say_hello)

    def say_hello(self, event):
        print("It works")

if __name__ == "__main__":
    app = App()
    app.mainloop()
</code>```

When I am replacing tk.Frame with TkinterDnD.Tk the code runs perfectly.

Thank you for your help.

I basicaly wanted to create a drag&drop listbox, but unfortunately I have create a window which inherits from the TkinterDnD class.

Body:
I am playing around with the functionality of tkinterdnd2. Hereby I created a Listbox for simple drag&drop action. I am looking for a solution to integrate tkinterdnd2 function drop_target_register, without replacing tk.Frame with TkinterDnD.Tk. How can I create a class instance of TkinterDnD, without creating a new window? Basically I just want give my listbox the drag&drop functionality.

class App(tk.Frame):
    def __init__(self):
        super().__init__()

        frame = tk.Frame(self)
        frame.pack(expand=tk.YES, fill=tk.BOTH)

        self.file_names_listbox = tk.Listbox(frame, selectmode=tk.SINGLE, background="darkgray", height=  100, width=100)
        self.file_names_listbox.pack()
        self.file_names_listbox.drop_target_register(DND_ALL)
        self.file_names_listbox.dnd_bind("<<Drop>>", self.say_hello)

    def say_hello(self, event):
        print("It works")

if __name__ == "__main__":
    app = App()
    app.mainloop()

When I am replacing tk.Frame with TkinterDnD.Tk the code runs perfectly.

Thank you for your help.

I basicaly wanted to create a drag&drop listbox, but unfortunately I have create a window which inherits from the TkinterDnD class.


问:
Take a percent of a list of strings in python with random sample
I have a dataset of pictures (dogs and cats), I want to split this data for the train and validation folder by percentage using the random sample but the issue is an error occurs in the method.

```<code>def split_data(SOURCE_DIR, TRAINING_DIR, VALIDATION_DIR, SPLIT_SIZE):
  for filename in os.listdir(SOURCE_DIR):
    try :
      if os.path.getsize(filename)<=0:
        print(f'{filename} is zero length, so ignoring.')
    except OSError :
      pass

  random.shuffle(os.listdir(SOURCE_DIR))

  proportion1 = random.sample(os.listdir(list(SOURCE_DIR)),SPLIT_SIZE)
  proportion2 = SOURCE_DIR - proportion1
  x = copyfile(proportion1, TRAINING_DIR)
  y = copyfile(proportion2, VALIDATION_DIR)
</code>```

It gives me this error:

```<code>  32   random.shuffle(os.listdir(SOURCE_DIR))
     33
---> 34   proportion1 = random.sample(os.listdir(list(SOURCE_DIR)),SPLIT_SIZE)
     35   proportion2 = SOURCE_DIR - proportion1
     36   x = copyfile(proportion1, TRAINING_DIR)

TypeError: listdir: path should be string, bytes, os.PathLike, integer or None, not list
</code>```

Body:
I have a dataset of pictures (dogs and cats), I want to split this data for the train and validation folder by percentage using the random sample but the issue is an error occurs in the method.

def split_data(SOURCE_DIR, TRAINING_DIR, VALIDATION_DIR, SPLIT_SIZE):
  for filename in os.listdir(SOURCE_DIR):
    try :
      if os.path.getsize(filename)<=0:
        print(f'{filename} is zero length, so ignoring.')
    except OSError :
      pass

  random.shuffle(os.listdir(SOURCE_DIR))

  proportion1 = random.sample(os.listdir(list(SOURCE_DIR)),SPLIT_SIZE)
  proportion2 = SOURCE_DIR - proportion1
  x = copyfile(proportion1, TRAINING_DIR)
  y = copyfile(proportion2, VALIDATION_DIR)

It gives me this error:

  32   random.shuffle(os.listdir(SOURCE_DIR))
     33
---> 34   proportion1 = random.sample(os.listdir(list(SOURCE_DIR)),SPLIT_SIZE)
     35   proportion2 = SOURCE_DIR - proportion1
     36   x = copyfile(proportion1, TRAINING_DIR)

TypeError: listdir: path should be string, bytes, os.PathLike, integer or None, not list


问:
Terraforming a private PostgreSQL server
I got a PostgreSQL server running in AWS RDS on a private subnet. I have an SSH server running on a public subnet within the same VPC that I can tunnel through to get to the database:

```<code>$ ssh -Nnf -L 5432:my-db-host:5432 my-bastion-host -p 2222
$ kmp-vm ~/projects/delivery (feature/terraform_postgres) $ psql -h localhost -U root dbname
Password for user root:
psql (14.5 (Ubuntu 14.5-0ubuntu0.22.04.1), server 13.7)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

dbname=>
</code>```

So far things are working as expected. I wish to use terraform to manage the schema and users and add a terraform.tf:

```<code>terraform {
  required_providers {
    postgresql = {
      source  = "cyrilgdn/postgresql"
      version = "~> 1.0"
    }
  }
}

provider "postgresql" {
  scheme          = "awspostgres"
  host            = "localhost"
  port            = 5432
  database        = "dbname"
  username        = "root"
  password        = "password"
  sslmode         = "disable"
  superuser       = false
  connect_timeout = 30
}

resource "postgresql_role" "admin" {
  name = "admin"
}
</code>```

Trying to apply this results in the following error:

```<code>│ Error: error detecting capabilities: error PostgreSQL version: x509: certificate is valid for my-db-host, not localhost
│
│   with postgresql_role.admin,
│   on _terraform.tf line 22, in resource "postgresql_role" "admin":
│   22: resource "postgresql_role" "admin" {
│
</code>```

How can I get around this?

UPDATE

This seems to be an awspostgres scheme thing (GoCloud). It seems to ignore the sslmode specified and it does not work with a socks proxy via ALL_PROXY either.

Switching scheme to postgres fixes the issue (unless sslmode is set to verify-full or alternatively via an socks proxy instead).

Given I do not really need the aws specific authentication methods this is an acceptable solution for my case here.

Body:
I got a PostgreSQL server running in AWS RDS on a private subnet. I have an SSH server running on a public subnet within the same VPC that I can tunnel through to get to the database:

$ ssh -Nnf -L 5432:my-db-host:5432 my-bastion-host -p 2222
$ kmp-vm ~/projects/delivery (feature/terraform_postgres) $ psql -h localhost -U root dbname
Password for user root:
psql (14.5 (Ubuntu 14.5-0ubuntu0.22.04.1), server 13.7)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

dbname=>

So far things are working as expected. I wish to use terraform to manage the schema and users and add a terraform.tf:

terraform {
  required_providers {
    postgresql = {
      source  = "cyrilgdn/postgresql"
      version = "~> 1.0"
    }
  }
}

provider "postgresql" {
  scheme          = "awspostgres"
  host            = "localhost"
  port            = 5432
  database        = "dbname"
  username        = "root"
  password        = "password"
  sslmode         = "disable"
  superuser       = false
  connect_timeout = 30
}

resource "postgresql_role" "admin" {
  name = "admin"
}

Trying to apply this results in the following error:

│ Error: error detecting capabilities: error PostgreSQL version: x509: certificate is valid for my-db-host, not localhost
│
│   with postgresql_role.admin,
│   on _terraform.tf line 22, in resource "postgresql_role" "admin":
│   22: resource "postgresql_role" "admin" {
│

How can I get around this?

UPDATE

This seems to be an awspostgres scheme thing (GoCloud). It seems to ignore the sslmode specified and it does not work with a socks proxy via ALL_PROXY either.

Switching scheme to postgres fixes the issue (unless sslmode is set to verify-full or alternatively via an socks proxy instead).

Given I do not really need the aws specific authentication methods this is an acceptable solution for my case here.


问:
The custom credential provider username and password are incorrect on windows server 2016
I am currently developing a custom credential provider in C#.  The program works well on windows 10 and 11.  When I tested it on windows server 2012 R2 and windows server 2016, I was prompted with incorrect user names and passwords.  I wish someone could tell me why and how to fix it.
Thanks!

public virtual int GetSerialization(
out \_CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE pcpgsr,
out \_CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION pcpcs,
out string ppszOptionalStatusText,
out \_CREDENTIAL_PROVIDER_STATUS_ICON pcpsiOptionalStatusIcon
)
{
Logger.Write("登陆");
try
{
pcpgsr = \_CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE.CPGSR_RETURN_CREDENTIAL_FINISHED;
pcpcs = new \_CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION();
var username = Common.GetNameFromSid(this.sid);
var domain = string.Empty;
if (username.Contains("\\"))
{
domain = username.Substring(0, username.IndexOf("\\") + 1);
if (!string.IsNullOrEmpty(domain))
{
username = $"{domain}\\{UserName}";
}
}
Logger.Write(username);
var password = Passwd;
Logger.Write(password);
var inCredSize = 0;
var inCredBuffer = Marshal.AllocCoTaskMem(0);

                if (!PInvoke.CredPackAuthenticationBuffer(0, username, password, inCredBuffer, ref inCredSize))
                {
                    Marshal.FreeCoTaskMem(inCredBuffer);
                    inCredBuffer = Marshal.AllocCoTaskMem(inCredSize);

                    if (PInvoke.CredPackAuthenticationBuffer(0, username, password, inCredBuffer, ref inCredSize))
                    {
                        ppszOptionalStatusText = string.Empty;
                        pcpsiOptionalStatusIcon = _CREDENTIAL_PROVIDER_STATUS_ICON.CPSI_SUCCESS;

                        pcpcs.clsidCredentialProvider = Guid.Parse("00006d50-0000-0000-b090-00006b0b0000");
                        pcpcs.rgbSerialization = inCredBuffer;
                        pcpcs.cbSerialization = (uint)inCredSize;

                        RetrieveNegotiateAuthPackage(out var authPackage);
                        pcpcs.ulAuthenticationPackage = authPackage;
                        Logger.Write("登陆成功");
                        return HRESULT.S_OK;
                    }

                    ppszOptionalStatusText = "Failed to pack credentials";
                    pcpsiOptionalStatusIcon = _CREDENTIAL_PROVIDER_STATUS_ICON.CPSI_ERROR;
                    return HRESULT.E_FAIL;
                }
            }
            catch (Exception ex)
            {
                // In case of any error, do not bring down winlogon
                Logger.Write(ex.ToString());
            }
            finally
            {
                shouldAutoLogin = false; // Block auto-login from going full-retard
                Passwd = String.Empty;
                UserName = String.Empty;
                this.view.Provider.autoLogon = false;
            }

            pcpgsr = _CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE.CPGSR_NO_CREDENTIAL_NOT_FINISHED;
            pcpcs = new _CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION();
            ppszOptionalStatusText = string.Empty;
            pcpsiOptionalStatusIcon = _CREDENTIAL_PROVIDER_STATUS_ICON.CPSI_NONE;
            return HRESULT.E_NOTIMPL;
        }

```
<pre class="lang-cs prettyprint-override"><code>
private int RetrieveNegotiateAuthPackage(out uint authPackage)
{
var status = PInvoke.LsaConnectUntrusted(out var lsaHandle);
//将 Negotiate 改为 Kerberos
using (var name = new PInvoke.LsaStringWrapper("Negotiate"))
{
status = PInvoke.LsaLookupAuthenticationPackage(lsaHandle, ref name.\_string, out authPackage);
}

            PInvoke.LsaDeregisterLogonProcess(lsaHandle);

            return (int)status;
        }

</code>```

static class PInvoke
{
//http://www.pinvoke.net/default.aspx/secur32/LsaLogonUser.html
\[StructLayout(LayoutKind.Sequential)\]
public struct LSA_STRING
{
public UInt16 Length;
public UInt16 MaximumLength;
public /*PCHAR*/ IntPtr Buffer;
}

        public class LsaStringWrapper : IDisposable
        {
            public LSA_STRING _string;

            public LsaStringWrapper(string value)
            {
                _string = new LSA_STRING();
                _string.Length = (ushort)value.Length;
                _string.MaximumLength = (ushort)value.Length;
                _string.Buffer = Marshal.StringToHGlobalAnsi(value);
            }

            ~LsaStringWrapper()
            {
                Dispose(false);
            }

            private void Dispose(bool disposing)
            {
                if (_string.Buffer != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(_string.Buffer);
                    _string.Buffer = IntPtr.Zero;
                }
                if (disposing)
                    GC.SuppressFinalize(this);
            }

            public void Dispose()
            {
                Dispose(true);
            }
        }

        [DllImport("secur32.dll", SetLastError = false)]
        public static extern uint LsaConnectUntrusted([Out] out IntPtr lsaHandle);

        [DllImport("secur32.dll", SetLastError = false)]
        public static extern uint LsaLookupAuthenticationPackage([In] IntPtr lsaHandle, [In] ref LSA_STRING packageName, [Out] out UInt32 authenticationPackage);

        [DllImport("secur32.dll", SetLastError = false)]
        public static extern uint LsaDeregisterLogonProcess([In] IntPtr lsaHandle);

        [DllImport("credui.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern bool CredPackAuthenticationBuffer(
            int dwFlags,
            string pszUserName,
            string pszPassword,
            IntPtr pPackedCredentials,
            ref int pcbPackedCredentials
        );
    }

```
```......
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] 登陆
2022-12-14 08:40:54Z \[Common.GetNameFromSid\]
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] WIN-R1RB1UK946H\\admin
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] 123qwe!@#
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] 登陆成功
2022-12-14 08:40:54Z \[CredentialProviderCredential.ReportResult\] ntsStatus: -1073741715; ntsSubstatus: -1073741595
2022-12-14 08:40:57Z \[CredentialProviderCredential.SetSelected\]
2022-12-14 08:40:59Z \[CredentialProviderCredential.SetDeselected\]
2022-12-14 08:41:05Z \[CredentialProviderCredential.UnAdvise\]
2022-12-14 08:41:05Z \[CredentialProviderBase.UnAdvise\]
```

I want it to be authenticated with a username and password

Body:
I am currently developing a custom credential provider in C#.  The program works well on windows 10 and 11.  When I tested it on windows server 2012 R2 and windows server 2016, I was prompted with incorrect user names and passwords.  I wish someone could tell me why and how to fix it.
Thanks!

public virtual int GetSerialization(
out \_CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE pcpgsr,
out \_CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION pcpcs,
out string ppszOptionalStatusText,
out \_CREDENTIAL_PROVIDER_STATUS_ICON pcpsiOptionalStatusIcon
)
{
Logger.Write("登陆");
try
{
pcpgsr = \_CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE.CPGSR_RETURN_CREDENTIAL_FINISHED;
pcpcs = new \_CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION();
var username = Common.GetNameFromSid(this.sid);
var domain = string.Empty;
if (username.Contains("\\"))
{
domain = username.Substring(0, username.IndexOf("\\") + 1);
if (!string.IsNullOrEmpty(domain))
{
username = $"{domain}\\{UserName}";
}
}
Logger.Write(username);
var password = Passwd;
Logger.Write(password);
var inCredSize = 0;
var inCredBuffer = Marshal.AllocCoTaskMem(0);

                if (!PInvoke.CredPackAuthenticationBuffer(0, username, password, inCredBuffer, ref inCredSize))
                {
                    Marshal.FreeCoTaskMem(inCredBuffer);
                    inCredBuffer = Marshal.AllocCoTaskMem(inCredSize);

                    if (PInvoke.CredPackAuthenticationBuffer(0, username, password, inCredBuffer, ref inCredSize))
                    {
                        ppszOptionalStatusText = string.Empty;
                        pcpsiOptionalStatusIcon = _CREDENTIAL_PROVIDER_STATUS_ICON.CPSI_SUCCESS;

                        pcpcs.clsidCredentialProvider = Guid.Parse("00006d50-0000-0000-b090-00006b0b0000");
                        pcpcs.rgbSerialization = inCredBuffer;
                        pcpcs.cbSerialization = (uint)inCredSize;

                        RetrieveNegotiateAuthPackage(out var authPackage);
                        pcpcs.ulAuthenticationPackage = authPackage;
                        Logger.Write("登陆成功");
                        return HRESULT.S_OK;
                    }

                    ppszOptionalStatusText = "Failed to pack credentials";
                    pcpsiOptionalStatusIcon = _CREDENTIAL_PROVIDER_STATUS_ICON.CPSI_ERROR;
                    return HRESULT.E_FAIL;
                }
            }
            catch (Exception ex)
            {
                // In case of any error, do not bring down winlogon
                Logger.Write(ex.ToString());
            }
            finally
            {
                shouldAutoLogin = false; // Block auto-login from going full-retard
                Passwd = String.Empty;
                UserName = String.Empty;
                this.view.Provider.autoLogon = false;
            }

            pcpgsr = _CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE.CPGSR_NO_CREDENTIAL_NOT_FINISHED;
            pcpcs = new _CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION();
            ppszOptionalStatusText = string.Empty;
            pcpsiOptionalStatusIcon = _CREDENTIAL_PROVIDER_STATUS_ICON.CPSI_NONE;
            return HRESULT.E_NOTIMPL;
        }

private int RetrieveNegotiateAuthPackage(out uint authPackage)
{
var status = PInvoke.LsaConnectUntrusted(out var lsaHandle);
//将 Negotiate 改为 Kerberos
using (var name = new PInvoke.LsaStringWrapper("Negotiate"))
{
status = PInvoke.LsaLookupAuthenticationPackage(lsaHandle, ref name.\_string, out authPackage);
}

            PInvoke.LsaDeregisterLogonProcess(lsaHandle);

            return (int)status;
        }

static class PInvoke
{
//http://www.pinvoke.net/default.aspx/secur32/LsaLogonUser.html
\[StructLayout(LayoutKind.Sequential)\]
public struct LSA_STRING
{
public UInt16 Length;
public UInt16 MaximumLength;
public /*PCHAR*/ IntPtr Buffer;
}

        public class LsaStringWrapper : IDisposable
        {
            public LSA_STRING _string;

            public LsaStringWrapper(string value)
            {
                _string = new LSA_STRING();
                _string.Length = (ushort)value.Length;
                _string.MaximumLength = (ushort)value.Length;
                _string.Buffer = Marshal.StringToHGlobalAnsi(value);
            }

            ~LsaStringWrapper()
            {
                Dispose(false);
            }

            private void Dispose(bool disposing)
            {
                if (_string.Buffer != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(_string.Buffer);
                    _string.Buffer = IntPtr.Zero;
                }
                if (disposing)
                    GC.SuppressFinalize(this);
            }

            public void Dispose()
            {
                Dispose(true);
            }
        }

        [DllImport("secur32.dll", SetLastError = false)]
        public static extern uint LsaConnectUntrusted([Out] out IntPtr lsaHandle);

        [DllImport("secur32.dll", SetLastError = false)]
        public static extern uint LsaLookupAuthenticationPackage([In] IntPtr lsaHandle, [In] ref LSA_STRING packageName, [Out] out UInt32 authenticationPackage);

        [DllImport("secur32.dll", SetLastError = false)]
        public static extern uint LsaDeregisterLogonProcess([In] IntPtr lsaHandle);

        [DllImport("credui.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern bool CredPackAuthenticationBuffer(
            int dwFlags,
            string pszUserName,
            string pszPassword,
            IntPtr pPackedCredentials,
            ref int pcbPackedCredentials
        );
    }

......
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] 登陆
2022-12-14 08:40:54Z \[Common.GetNameFromSid\]
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] WIN-R1RB1UK946H\\admin
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] 123qwe!@#
2022-12-14 08:40:54Z \[CredentialProviderCredential.GetSerialization\] 登陆成功
2022-12-14 08:40:54Z \[CredentialProviderCredential.ReportResult\] ntsStatus: -1073741715; ntsSubstatus: -1073741595
2022-12-14 08:40:57Z \[CredentialProviderCredential.SetSelected\]
2022-12-14 08:40:59Z \[CredentialProviderCredential.SetDeselected\]
2022-12-14 08:41:05Z \[CredentialProviderCredential.UnAdvise\]
2022-12-14 08:41:05Z \[CredentialProviderBase.UnAdvise\]

I want it to be authenticated with a username and password


问:
Debugging an abort() problem on a users machine
A user of my software is reporting that it is terminating without a "by your leave".  I have catch handlers in my main thread and where it is possible on other threads.  I also have a terminate handler.  Most of these use StackWalker to try to generate a back trace (on Windows).

I expect that an exception may be happening on a thread where I can't install catch handlers.

Is there any way to find out what the call stack was at the time that abort() was called (on any thread) without having access to the user machine - assume the user doesn't have the skill set to run a debugger.

Thanks
David


问:
No file matches include / exclude patterns in serverless deployment
Tyring to deploy my app on dev server. I did add a exclude field earlier to exclude node_modules from the deployment which caused this error. But i've removed that but the error is still here.

Any possible solutions?

Serverless.yml

```<code>service: lambda-woo-user-service-dev-app
provider:
  name: aws
  runtime: nodejs16.x
  stage: dev
  region: us-east-1
  memorySize: 2048
  apiGateway:
    restApiId: pc92cc9jz8
    restApiRootResourceId: 3y783dgut3
  provider.iam.role.statements:
    - Effect: "Allow"
      Action:
        - "s3:*"
      Resource: { "Fn::Join": ["", ["arn:aws:s3:::wooo-s3", "/*"]] }
plugins:
  - serverless-dotenv-plugin
  - serverless-plugin-warmup
custom:
  warmup:
    default:
      enabled: true # Whether to warm up functions by default or not
      folderName: ".warmup" # Name of the folder created for the generated warmup
      cleanFolder: false
      memorySize: 256
functions:
  app:
    handler: server.handler
    warmup:
      default:
        enabled: true
    timeout: 120
    events:
      - http:
          path: /
          method: ANY
          cors: true
          # contentHandling: CONVERT_TO_BINARY
      - http:
          path: /{proxy+}
          method: ANY
          cors: true
          # contentHandling: CONVERT_TO_BINARY
</code>```

Error Screen:

```<code>$ serverless
DOTENV: Loading environment variables from .env:
         - PORT
         - APP_NAME
         - EMAIL

? Do you want to deploy now? Yes
DOTENV: Loading environment variables from .env:
         - PORT
         - APP_NAME
         - EMAIL

Deploying lambda-woo-user-service-dev-app to stage prod (us-east-1)
WarmUp: Creating warmer "default" to warm up 1 function

× Stack lambda-woo-user-service-dev-app-prod failed to deploy (2s)
Environment: win32, node 18.12.1, framework 3.25.1, plugin 6.2.2, SDK 4.3.2
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
No file matches include / exclude patterns

1 deprecation found: run 'serverless doctor' for more details
</code>```

Cannot excatly find where the issue is, I've removed the exclude stage but still the same error.

Body:
Tyring to deploy my app on dev server. I did add a exclude field earlier to exclude node_modules from the deployment which caused this error. But i've removed that but the error is still here.

Any possible solutions?

Serverless.yml

service: lambda-woo-user-service-dev-app
provider:
  name: aws
  runtime: nodejs16.x
  stage: dev
  region: us-east-1
  memorySize: 2048
  apiGateway:
    restApiId: pc92cc9jz8
    restApiRootResourceId: 3y783dgut3
  provider.iam.role.statements:
    - Effect: "Allow"
      Action:
        - "s3:*"
      Resource: { "Fn::Join": ["", ["arn:aws:s3:::wooo-s3", "/*"]] }
plugins:
  - serverless-dotenv-plugin
  - serverless-plugin-warmup
custom:
  warmup:
    default:
      enabled: true # Whether to warm up functions by default or not
      folderName: ".warmup" # Name of the folder created for the generated warmup
      cleanFolder: false
      memorySize: 256
functions:
  app:
    handler: server.handler
    warmup:
      default:
        enabled: true
    timeout: 120
    events:
      - http:
          path: /
          method: ANY
          cors: true
          # contentHandling: CONVERT_TO_BINARY
      - http:
          path: /{proxy+}
          method: ANY
          cors: true
          # contentHandling: CONVERT_TO_BINARY

Error Screen:

$ serverless
DOTENV: Loading environment variables from .env:
         - PORT
         - APP_NAME
         - EMAIL

? Do you want to deploy now? Yes
DOTENV: Loading environment variables from .env:
         - PORT
         - APP_NAME
         - EMAIL

Deploying lambda-woo-user-service-dev-app to stage prod (us-east-1)
WarmUp: Creating warmer "default" to warm up 1 function

× Stack lambda-woo-user-service-dev-app-prod failed to deploy (2s)
Environment: win32, node 18.12.1, framework 3.25.1, plugin 6.2.2, SDK 4.3.2
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
No file matches include / exclude patterns

1 deprecation found: run 'serverless doctor' for more details

Cannot excatly find where the issue is, I've removed the exclude stage but still the same error.


问:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider
I have deployed a Blazor .NET 7 app to IIS on a server and when I try to login I get the following error.

Win32Exception: No process is on the other end of the pipe.
SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

The app works fine on my development PC inside VS 2022.

After the first error, when I try again to login, I get the following error
SqlException: Login failed for user 'sa'.

I have not used the sa DB login.

I enabled the sa login in SSMS and checked. Still the same result.


问:
How to presist some header among all ApiGateway WS session transactions
Using ApiGateway websockets, client initiates connection through AWS ApiGateway with authorization header, ApiGateway passes that header from it's context as header to the server endpoint. I want to get this specific header when client invokes $disconnect route upon exiting the connection. is there a way to tell ApiGateway to keep that header along the connection lifetime?</p>


问:
Suggestions to make cross check between lists faster in Python
i am implementing a cross check between records: i have a list of record (which is a list itself) and i have to find the best match (with some specific controls like time tolerances, etc) line by line, my current code is something like:

```<code>def CountOcurrencies(qsoToCheck: list, qsoList: list):
    # Loop in QSOs
    for qsoLine in qsoList:
        # Check if Call and DX matches
        if qsoToCheck[4] == qsoLine[0] and qsoToCheck[0] == qsoLine[4]:
           ...
           # Check if....
             ...
   return resultCode
</code>```

and the main code calls this method for each record:

```<code> # Loop for every QSO to get matches
    for qsoIndex in range(len(listValidQso)):
        # Write output of CountOcurrencies to Valid QSO array
        listValidQso[qsoIndex][19] = str(CountOcurrencies(listValidQso[qsoIndex], listValidQso))
</code>```

problem is that listValidQso is a list made of around 60K lists and the complete code takes around 10 minutes. I tried the numpy where to filter a subset of the bit list and execute the method in the filtered list but result is almost the same (most of processing time is used in performing the numpy.where function)
Any suggestion?

I tried using this code in the CountOcurrencies method

```<code> # Filter QSO list to save some time
    print("input size: " + str(len(qsoList)))
    npAry = numpy.array(qsoList)
    rows, cols = numpy.where(npAry == qsoToCheck[0])
    filteredQsoList = npAry[rows]
    print("output size: " + str(len(filteredQsoList)))
</code>```

but this filtering takes around 1.5 sec each and the total time is almost unchanged

Body:
i am implementing a cross check between records: i have a list of record (which is a list itself) and i have to find the best match (with some specific controls like time tolerances, etc) line by line, my current code is something like:

def CountOcurrencies(qsoToCheck: list, qsoList: list):
    # Loop in QSOs
    for qsoLine in qsoList:
        # Check if Call and DX matches
        if qsoToCheck[4] == qsoLine[0] and qsoToCheck[0] == qsoLine[4]:
           ...
           # Check if....
             ...
   return resultCode

and the main code calls this method for each record:

 # Loop for every QSO to get matches
    for qsoIndex in range(len(listValidQso)):
        # Write output of CountOcurrencies to Valid QSO array
        listValidQso[qsoIndex][19] = str(CountOcurrencies(listValidQso[qsoIndex], listValidQso))

problem is that listValidQso is a list made of around 60K lists and the complete code takes around 10 minutes. I tried the numpy where to filter a subset of the bit list and execute the method in the filtered list but result is almost the same (most of processing time is used in performing the numpy.where function)
Any suggestion?

I tried using this code in the CountOcurrencies method

 # Filter QSO list to save some time
    print("input size: " + str(len(qsoList)))
    npAry = numpy.array(qsoList)
    rows, cols = numpy.where(npAry == qsoToCheck[0])
    filteredQsoList = npAry[rows]
    print("output size: " + str(len(filteredQsoList)))

but this filtering takes around 1.5 sec each and the total time is almost unchanged


问:
How to generate test with playwright and codegen from a docker container?
I'm using their standard image mcr.microsoft.com/playwright:v1.28.1-focal.
When trying to launch the command yarn playwright codegen wikipedia.org from my docker container (for the sake of an example) I'm getting the following error:

```<code>Looks like you launched a headed browser without having a XServer running.
Set either 'headless: true' or use 'xvfb-run <your-playwright-app>' before running Playwright.
</code>```

I don't want to run it as headless cause I wan't to generate tests.
Not sure how to setup an Xserver for my purpose, and the doc doesn't seem to mention this issue.

Any help appreciated

Body:
I'm using their standard image mcr.microsoft.com/playwright:v1.28.1-focal.
When trying to launch the command yarn playwright codegen wikipedia.org from my docker container (for the sake of an example) I'm getting the following error:

Looks like you launched a headed browser without having a XServer running.
Set either 'headless: true' or use 'xvfb-run <your-playwright-app>' before running Playwright.

I don't want to run it as headless cause I wan't to generate tests.
Not sure how to setup an Xserver for my purpose, and the doc doesn't seem to mention this issue.

Any help appreciated


问:
Why is JAXB Moxy 2.3.2 capitalizing class names compared to 2.1.2?
one of my projects is using EclipseLink Moxy since years, it was using version 2.1.2.

From another project, we got code additions and we thought we should also use the version that is used by those other projects (2.3.2).

But the original 2.1.2.-Code threw the exception like "Missing class for indicator field value"... it said that the type "ArticleV2BEAN" could not be found, although nothing had changed with regards to the JAXB classes, there is still the ArticleV2Bean.java correctly set up.
Now I downgraded again to 2.1.2. and the same code runs again correctly.

My question is: why is 2.3.2 looking for the capital letter version "ArticleV2BEAN" instead of "ArticleV2Bean" ?

What are your thoughts on this?


问:
How can I increse the space between YAxis legends or make them on a single line in re-charts?
```<code>
    <ResponsiveContainer width="100%" height="100%">
      <BarChart
        data={data}
        layout="vertical"
        margin={{
          top: 40, right: 40, bottom: 20, left: 100
        }}

      >
        <CartesianGrid strokeDasharray="1 1" />
        <XAxis interval={0} type="number" dataKey="race" />
        <YAxis type="category" dataKey="name" style={{ fontSize: '12px' }} />
        <Tooltip />
        <Legend />
        <Bar dataKey="race" fill="#4246e7" barSize={100} />
      </BarChart>
    </ResponsiveContainer>enter image description here
</code>```

Hi guys,

How can I increse the space between YAxis legends in re-chart? I tried with with dx, but it moves all line to right or left?

Example I want American Indian or Alaska Native on a single line or some space between this and the rest of the labels.

Body:
    <ResponsiveContainer width="100%" height="100%">
      <BarChart
        data={data}
        layout="vertical"
        margin={{
          top: 40, right: 40, bottom: 20, left: 100
        }}

      >
        <CartesianGrid strokeDasharray="1 1" />
        <XAxis interval={0} type="number" dataKey="race" />
        <YAxis type="category" dataKey="name" style={{ fontSize: '12px' }} />
        <Tooltip />
        <Legend />
        <Bar dataKey="race" fill="#4246e7" barSize={100} />
      </BarChart>
    </ResponsiveContainer>enter image description here

Hi guys,

How can I increse the space between YAxis legends in re-chart? I tried with with dx, but it moves all line to right or left?

Example I want American Indian or Alaska Native on a single line or some space between this and the rest of the labels.


问:
How to locate the object about stylesheet error with hex-code?
Although my app run successfully when I run my qt code, qt app-output window show some info like this
"Could not parse stylesheet of object 0x20cea648". But I don't know WHICH object stylesheet run in error and how to use this kind of HEX-code.

I set stylesheet in this way like "

```<code> ui->ContinueKeyChoiceBox->setStyleSheet("QComboBox{background:rgba(253,239,242,100);\
                                            border:1px solid rgba(253,239,242,255);\
                                            border-radius: 4px;\
                                            color: #000;\
                                            background: transparent;\
                                            }");
</code>```

"
Because I set many object's stylesheet in this way

Use the hex-code which app-output window supplied to locate which object's stylesheet set in error on earth.

Body:
Although my app run successfully when I run my qt code, qt app-output window show some info like this
"Could not parse stylesheet of object 0x20cea648". But I don't know WHICH object stylesheet run in error and how to use this kind of HEX-code.

I set stylesheet in this way like "

 ui->ContinueKeyChoiceBox->setStyleSheet("QComboBox{background:rgba(253,239,242,100);\
                                            border:1px solid rgba(253,239,242,255);\
                                            border-radius: 4px;\
                                            color: #000;\
                                            background: transparent;\
                                            }");

"
Because I set many object's stylesheet in this way

Use the hex-code which app-output window supplied to locate which object's stylesheet set in error on earth.


问:
Using WHERE group IN(g1,g2,...,gn) leads to "The query is too large" error, any alternative
I have a list of groups, and I wish to find all the emails that are connected with them in a large table. For that I was using the following query:

```<code>groups = "('g1','g2',...,'gn')"

query =\
    f"""
        SELECT group, email,
        FROM table
        WHERE group IN{groups}
    """
</code>```

The error I get is:

```<code>BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/prod-dwh-353210/jobs?prettyPrint=false: The query is too large. The maximum standard SQL query length is 1024.00K characters, including comments and white space characters.
</code>```

Is there any alternative way to filter table by a long list without mentioning it explicitly?

EDIT: Fixing the string in groups

Body:
I have a list of groups, and I wish to find all the emails that are connected with them in a large table. For that I was using the following query:

groups = "('g1','g2',...,'gn')"

query =\
    f"""
        SELECT group, email,
        FROM table
        WHERE group IN{groups}
    """

The error I get is:

BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/prod-dwh-353210/jobs?prettyPrint=false: The query is too large. The maximum standard SQL query length is 1024.00K characters, including comments and white space characters.

Is there any alternative way to filter table by a long list without mentioning it explicitly?

EDIT: Fixing the string in groups


问:
On a Linux EC2 instance, the boto3 Session.get credential() function returns None
I am trying to take manual snapshot of my elasticsearch domain and save it to a S3 bucket. As a part of the process I am trying to register a manual snapshot repository using python client code on Linux ec2 instance. I am using boto3 to get my credentials. But boto3 can not find any credentials and it returns None.

python code:

```<code>import boto3
import requests
from requests_aws4auth import AWS4Auth

host = 'elastic-domain'
region = 'us-east-1' # For example, us-west-1
service = 'es'
credentials = boto3.Session(region_name=region).get_credentials()
print(credentials)
awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, region, service, session_token=credentials.token)

# Register repository
path = '_snapshot/elastic-repo' # the Elasticsearch API endpoint
url = host + path

payload = {
  "type": "s3",
  "settings": {
    "bucket": "bucket-name",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::account-id:role/specified-role"
  }
}

headers = {"Content-Type": "application/json"}

r = requests.put(url, auth=awsauth, json=payload, headers=headers)

print(r.status_code)
print(r.text)
</code>```

When I print credentials in my code, it returns None. I have set my env variables with access_key, secret_key and region_name. Still does not work. What may be the reason?

Body:
I am trying to take manual snapshot of my elasticsearch domain and save it to a S3 bucket. As a part of the process I am trying to register a manual snapshot repository using python client code on Linux ec2 instance. I am using boto3 to get my credentials. But boto3 can not find any credentials and it returns None.

python code:

import boto3
import requests
from requests_aws4auth import AWS4Auth

host = 'elastic-domain'
region = 'us-east-1' # For example, us-west-1
service = 'es'
credentials = boto3.Session(region_name=region).get_credentials()
print(credentials)
awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, region, service, session_token=credentials.token)

# Register repository
path = '_snapshot/elastic-repo' # the Elasticsearch API endpoint
url = host + path

payload = {
  "type": "s3",
  "settings": {
    "bucket": "bucket-name",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::account-id:role/specified-role"
  }
}

headers = {"Content-Type": "application/json"}

r = requests.put(url, auth=awsauth, json=payload, headers=headers)

print(r.status_code)
print(r.text)

When I print credentials in my code, it returns None. I have set my env variables with access_key, secret_key and region_name. Still does not work. What may be the reason?


问:
online tool to trigger specific api request responses
I often have a situation where I would like some url that returns some specific response code / body / exception

Is there some website where I could do something like this:

GET https://somedomain.com/response/404 -> returns 404

POST https://somedomain.com/response/500-> returns 500 with same body that I provide in the post request


问:
failed to access class com.sun.activation.registries.LogSupport from class javax.activation.MailcapCommandMap
i am trying to use javamail api to send send mail using host as smtp.

dependencies :

```<code><groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</code>```

```<code><groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</code>```

```<code><groupId>com.sun.mail</groupId>
<artifactId>smtp</artifactId>
<version>1.4.5</version>
</code>```

```<code><groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>2.0.0</version>
</code>```

Error i am getting is :

```<code>java.lang.IllegalAccessError: failed to access class com.sun.activation.registries.LogSupport from class javax.activation.MailcapCommandMap (com.sun.activation.registries.LogSupport and javax.activation.MailcapCommandMap are in unnamed module of loader 'app')
at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:140) ~[activation-1.1.jar:1.1]
at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:61) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.getCommandMap(DataHandler.java:153) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:611) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.writeTo(DataHandler.java:315) ~[activation-1.1.jar:1.1]
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:340) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1575) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2271) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2231) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Transport.send(Transport.java:123) ~[javax.mail-1.6.2.jar:1.6.2]
at example.controller.AuthController.otpInput(AuthController.java:127) ~[classes/:na]
</code>```

Body:
i am trying to use javamail api to send send mail using host as smtp.

dependencies :

<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>

<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>

<groupId>com.sun.mail</groupId>
<artifactId>smtp</artifactId>
<version>1.4.5</version>

<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>2.0.0</version>

Error i am getting is :

java.lang.IllegalAccessError: failed to access class com.sun.activation.registries.LogSupport from class javax.activation.MailcapCommandMap (com.sun.activation.registries.LogSupport and javax.activation.MailcapCommandMap are in unnamed module of loader 'app')
at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:140) ~[activation-1.1.jar:1.1]
at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:61) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.getCommandMap(DataHandler.java:153) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:611) ~[activation-1.1.jar:1.1]
at javax.activation.DataHandler.writeTo(DataHandler.java:315) ~[activation-1.1.jar:1.1]
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:340) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1575) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2271) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2231) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Transport.send(Transport.java:123) ~[javax.mail-1.6.2.jar:1.6.2]
at example.controller.AuthController.otpInput(AuthController.java:127) ~[classes/:na]


问:
Getting NoSuchMethodError from api developed using Maven
I am testing a REST API. During execution, I receive below stack trace

SEVERE: StandardWrapper.Throwable
java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:331)
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
        at javax.servlet.GenericServlet.init(Unknown Source)
        at org.apache.catalina.core.StandardWrapper.initServlet(Unknown Source)
        at org.apache.catalina.core.StandardWrapper.loadServlet(Unknown Source)
        at org.apache.catalina.core.StandardWrapper.allocate(Unknown Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
        at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
        at org.apache.catalina.connector.CoyoteAdapter.service(Unknown Source)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(Unknown Source)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Unknown Source)
        at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:744)
```
<p>I am using javax.ws.rs-api-2.0.1.jar which contains below method but still it giving me above error</p>
```public Map<String, Object> getProperties() {
    return Collections.emptyMap();
}
```

Screenshot of uncompiled class file

Body:
I am testing a REST API. During execution, I receive below stack trace

SEVERE: StandardWrapper.Throwable
java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:331)
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:392)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
        at javax.servlet.GenericServlet.init(Unknown Source)
        at org.apache.catalina.core.StandardWrapper.initServlet(Unknown Source)
        at org.apache.catalina.core.StandardWrapper.loadServlet(Unknown Source)
        at org.apache.catalina.core.StandardWrapper.allocate(Unknown Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
        at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
        at org.apache.catalina.connector.CoyoteAdapter.service(Unknown Source)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(Unknown Source)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Unknown Source)
        at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:744)

I am using javax.ws.rs-api-2.0.1.jar which contains below method but still it giving me above error

public Map<String, Object> getProperties() {
    return Collections.emptyMap();
}

Screenshot of uncompiled class file


问:
How to find which files takes storage space on my RDS Postgresql instance?
We are working on a RDS Postgresql 14.4 instance and lately we discovered that our storage space was being bloated. We went from 46Gb total size on a freshly migrated database to 81Gb in the course of a week.

We found this article : diskfull-error-rds-postgresql

We checked if we had a huge number of dead rows:

SELECT SUM(n_dead_tup) FROM pg_stat_all_tables WHERE n_dead_tup > 0;
which gave us 114836
It doesn't seem significant considering the amount of space that is taken.

We checked our database total space:

SELECT pg_size_pretty(pg_database_size('db_production'));
It gave us 81Gb

then we compared it to:

SELECT pg_size_pretty(SUM(pg_relation_size(oid))) FROM pg_class;
which gave us 46Gb

In the article it is stated that it might be caused by orphan files that are being stored.

Unfortunately we cant execute a VACUUM FULL on the whole database because we can't afford downtime on our platform

I'm trying to understand where this 35Gb gap is coming from in order to handle it manually (if possible)

Does anyone have any clue on how I could solve this issue ?

Thank you in advance for your kind help :)

Edit: After running SELECT pg_size_pretty(SUM(pg_total_relation_size(oid))) FROM pg_class; it gave us 70Gb
So that is much closer to our actual database size but we still are missing 11Gb :(


问:
react-datepicker, How to expose both startDate and endDate on a button using format
How to expose both startDate and endDate on a button using format.

```<code><>
      <button className="example-custom-input" onClick={handleClick}>
        {format(startDate, "dd-MM-yyyy")}
      </button>
      {isOpen && (
        <DatePicker selected={startDate} onChange={handleChange} inline />
      )}
    </>
</code>```
```<code><button className="example-custom-input" onClick={handleClick}>
  {format(startDate + endDate, "MM dd")}
</button>
</code>```

start:'MM dd' ~ end:'MM dd'

'MM dd ~ MM dd'

Body:
How to expose both startDate and endDate on a button using format.

<>
      <button className="example-custom-input" onClick={handleClick}>
        {format(startDate, "dd-MM-yyyy")}
      </button>
      {isOpen && (
        <DatePicker selected={startDate} onChange={handleChange} inline />
      )}
    </>

<button className="example-custom-input" onClick={handleClick}>
  {format(startDate + endDate, "MM dd")}
</button>

start:'MM dd' ~ end:'MM dd'

'MM dd ~ MM dd'


问:
Getting compile time error while adding pushkit sdk in iOS swift
Hello I am getting compile time error after adding

```<code>  pod 'HmsPushSDK'

</code>```

using pod

Help me to resolve this issue .thanks

I tried all according documentation.

Body:
Hello I am getting compile time error after adding

  pod 'HmsPushSDK'

using pod

Help me to resolve this issue .thanks

I tried all according documentation.


问:
NG 13 update to NG 14/15: Throttling navigation to prevent the browser from hanging
Started this app 5 years ago with Angular 2, till Angular 13 the dynamic routes lazy loaded works fine (with canActivate DynamicPathGuard), after a upgrade/update to NG 14/15 the browsers keeps hanging in a infinite loop here!
Can't see what I'm missing here, of if there a breaking changes!

Within the attached stackblitz for reproduction:
within the package.json the Angular Core is set to 13.2.0 as starter, you can see that everything works fine when you navigate.

Try updating the package.json to 14.2.0 or 15.0.2 and you see the routing doesn't work anymore, and the browser freezes after a while!

https://stackblitz.com/edit/dynamic-routes-lazy-loaded-pydumm?file=package.json

// dynamicPathGuard.ts
import { Injectable, Component } from '@angular/core';
import {
    Router,
    CanActivate,
    ActivatedRouteSnapshot,
    RouterStateSnapshot,
} from '@angular/router';
import { parseUrlPathInSegments } from '../classes/url-path-parser';

@Injectable()
export class DynamicPathGuard implements CanActivate {
    constructor(private router: Router) {}

    async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
        const segments = parseUrlPathInSegments(state.url);
        const lastPath = segments.pop();

        if (lastPath === 'dynamic') {
            this.router.navigateByUrl(state.url);
        } else {
            this.router.navigateByUrl('/404');
        }

        return false;
    }
}
```


问:
How to update the ganache server after forking, to always get the current/latest blocknumber (or blockchain state)?
For some reason ganache does not update the forked local chain. And Because of that I get the "missing trie node" error sometimes.

Any ideas? Thx!

my ganache server code:

```<code>...
        let options = {
            fork:{
                url: fork_main_url,
                blockNumber: 'latest',
                preLatestConfirmations: 0, //new
                requestsPerSecond: 0,
                deleteCache: true,
                disableCache: true,
            },
            logging: {
                quiet: true,
            },
            miner: {//new
                blockTime: 0,
            },
            server: {
                ws: true,
            }
        };

            this.server = ganache.server(options);
            this.server.listen(PORT);
...

</code>```

Reforking and recreate the whole server when a new node is mined (see below). But it slows the all process.

```<code>
provider.on('block', async(blckNr)=> {
...
})
</code>```

Body:
For some reason ganache does not update the forked local chain. And Because of that I get the "missing trie node" error sometimes.

Any ideas? Thx!

my ganache server code:

...
        let options = {
            fork:{
                url: fork_main_url,
                blockNumber: 'latest',
                preLatestConfirmations: 0, //new
                requestsPerSecond: 0,
                deleteCache: true,
                disableCache: true,
            },
            logging: {
                quiet: true,
            },
            miner: {//new
                blockTime: 0,
            },
            server: {
                ws: true,
            }
        };

            this.server = ganache.server(options);
            this.server.listen(PORT);
...

Reforking and recreate the whole server when a new node is mined (see below). But it slows the all process.

provider.on('block', async(blckNr)=> {
...
})


问:
Bash counting script broke after adding to 2 strings with string-comparison
I had a functional counting script that broke after I added more in 2 strings. Now the script counts beyond the specified stopping point. I'm stumped. Please help.

```<code># date time counter
# test script - stripped to minimum summary of pertinent parts

# the script worked flawlessly until i added the leading date and trailing timezone
ss_stop=03
mm_stop=00
count_stop="2022-02-28 00:$mm_stop:$ss_stop CST"

# other vars declared

# while loop with if statements that ends in a `break` once string comparison
# [ $count == $count_stop ] was true

##### i believe the problem may be in this string comparison of the modified strings
if [ $count == $count_stop ]; then
    break
fi
</code>```

Comparison of $count == $count_stop below:

```<code># original
# script view
count="00:$mm_count:$ss_count"
count_stop="00:$mm_stop:$ss_stop"
#shell echo
count="00:00:03"
count_stop="00:00:03"

# modified (this broke the script)
# script view
count="2022-02-28 00:$mm_count:$ss_count CST"
count_stop="2022-02-28 00:$mm_stop:$ss_stop CST"
#shell echo
count="2022-02-28 00:00:03 CST"
count_stop="2022-02-28 00:00:03 CST"
</code>```

Again: the script worked flawlessly until I added the leading date and trailing timezone. Now the script counts beyond the specified stopping point.

Body:
I had a functional counting script that broke after I added more in 2 strings. Now the script counts beyond the specified stopping point. I'm stumped. Please help.

# date time counter
# test script - stripped to minimum summary of pertinent parts

# the script worked flawlessly until i added the leading date and trailing timezone
ss_stop=03
mm_stop=00
count_stop="2022-02-28 00:$mm_stop:$ss_stop CST"

# other vars declared

# while loop with if statements that ends in a `break` once string comparison
# [ $count == $count_stop ] was true

##### i believe the problem may be in this string comparison of the modified strings
if [ $count == $count_stop ]; then
    break
fi

Comparison of $count == $count_stop below:

# original
# script view
count="00:$mm_count:$ss_count"
count_stop="00:$mm_stop:$ss_stop"
#shell echo
count="00:00:03"
count_stop="00:00:03"

# modified (this broke the script)
# script view
count="2022-02-28 00:$mm_count:$ss_count CST"
count_stop="2022-02-28 00:$mm_stop:$ss_stop CST"
#shell echo
count="2022-02-28 00:00:03 CST"
count_stop="2022-02-28 00:00:03 CST"

Again: the script worked flawlessly until I added the leading date and trailing timezone. Now the script counts beyond the specified stopping point.


问:
Removing Widgets with defined ObjectName[s] in a for loop
First of all, here is my current code in question:

```<code>def scpSearched(self):

    scpInfo = SCPScraper(self.scpInput.text())  #   Store SCPScraper dictionary in a variable
                                                #   ↑   scpInfo = {"Heading":"text","Heading2":"text"...}
    self.scpInformation = QWidget() #   Widget to store all SCP Information

    index = 1
    for key in scpInfo:
        objectNameHeading = "Heading {}".format(index)  #   Create ObjectName for Headings
        objectNameText = "Text {}".format(index)  #   Create ObjectName for Text

        if self.scpSearchedBool == True:    #   Default self.scpSearchedBool is False
                                            #   ↑ If True, then the screen is filled with previous text
            self.layout.removeWidget(self.scpHeadingLabel.objectNameHeading)    #   Atempted Removal of previous Headings
            self.scpHeadingLabel = None
            self.layout.removeWidget(self.scpTextLabel.objectNameText)  #   #   Atempted Removal of previous Text
            self.scpTextLabel = None

        self.scpHeadingLabel = QLabel(self.scpInformation)
        self.scpHeadingLabel.setText(key)   #   Set Heading to current key
        self.scpHeadingLabel.setObjectName(objectNameHeading)   #   Create addressable name based on index

        self.scpTextLabel = QLabel(self.scpInformation)
        self.scpTextLabel.setText(scpInfo[key])  #   Set Text to Text at current key of scpInfo
        self.scpTextLabel.setObjectName(objectNameText) #   Create addressable name based on index
        self.scpTextLabel.setWordWrap(True)

        self.layout.addWidget(self.scpHeadingLabel, index, 0)
        self.layout.addWidget(self.scpTextLabel, index, 1)

        index += 1

    self.scpSearchedBool = True #   Indicate that the page has contents on it
</code>```

I am creating an application that displays the contents of a dictionary. The amount of contents it has to display cannot be pre-determined as it is scraped from the web, and because of this I generate Qlabels through a for loop. I have made each label have a setObjectName, that is generated depending on a variable, index.

However an issue I am noticing is that text gets overlapped, as it is not removed as seen below:

Logically, I decided to come up with a way to remove each label and then replace it, and I wanted to use the ObjectNames I had assigned them, which is what is seen in the code above. However, I assume that my referencing of the widgets by their ObjectName is incorrect.

However when I used the lines self.layout.removeWidget(self.scpHeadingLabel) and self.layout.removeWidget(self.scpTextLabel), only the last element of the text is replaced, with the rest staying the same, which is peculiar as if the code was working, shouldn't it delete the previous text, not keep it?

I am very puzzled and have many questions. How do I address widgets by their ObjectNames, since the way I am doing it is incorrect? How do I remove each QLabel if not by ObjectName? What is going on with the replacement of just the last label?

Body:
First of all, here is my current code in question:

def scpSearched(self):

    scpInfo = SCPScraper(self.scpInput.text())  #   Store SCPScraper dictionary in a variable
                                                #   ↑   scpInfo = {"Heading":"text","Heading2":"text"...}
    self.scpInformation = QWidget() #   Widget to store all SCP Information

    index = 1
    for key in scpInfo:
        objectNameHeading = "Heading {}".format(index)  #   Create ObjectName for Headings
        objectNameText = "Text {}".format(index)  #   Create ObjectName for Text

        if self.scpSearchedBool == True:    #   Default self.scpSearchedBool is False
                                            #   ↑ If True, then the screen is filled with previous text
            self.layout.removeWidget(self.scpHeadingLabel.objectNameHeading)    #   Atempted Removal of previous Headings
            self.scpHeadingLabel = None
            self.layout.removeWidget(self.scpTextLabel.objectNameText)  #   #   Atempted Removal of previous Text
            self.scpTextLabel = None

        self.scpHeadingLabel = QLabel(self.scpInformation)
        self.scpHeadingLabel.setText(key)   #   Set Heading to current key
        self.scpHeadingLabel.setObjectName(objectNameHeading)   #   Create addressable name based on index

        self.scpTextLabel = QLabel(self.scpInformation)
        self.scpTextLabel.setText(scpInfo[key])  #   Set Text to Text at current key of scpInfo
        self.scpTextLabel.setObjectName(objectNameText) #   Create addressable name based on index
        self.scpTextLabel.setWordWrap(True)

        self.layout.addWidget(self.scpHeadingLabel, index, 0)
        self.layout.addWidget(self.scpTextLabel, index, 1)

        index += 1

    self.scpSearchedBool = True #   Indicate that the page has contents on it

I am creating an application that displays the contents of a dictionary. The amount of contents it has to display cannot be pre-determined as it is scraped from the web, and because of this I generate Qlabels through a for loop. I have made each label have a setObjectName, that is generated depending on a variable, index.

However an issue I am noticing is that text gets overlapped, as it is not removed as seen below:

Logically, I decided to come up with a way to remove each label and then replace it, and I wanted to use the ObjectNames I had assigned them, which is what is seen in the code above. However, I assume that my referencing of the widgets by their ObjectName is incorrect.

However when I used the lines self.layout.removeWidget(self.scpHeadingLabel) and self.layout.removeWidget(self.scpTextLabel), only the last element of the text is replaced, with the rest staying the same, which is peculiar as if the code was working, shouldn't it delete the previous text, not keep it?

I am very puzzled and have many questions. How do I address widgets by their ObjectNames, since the way I am doing it is incorrect? How do I remove each QLabel if not by ObjectName? What is going on with the replacement of just the last label?