8 – How do I safely mark the listener as passive and keep it working?

I’m trying to optimize the website performance according to the Google PageSpeed recommendations. One of the advices is to set touch and wheel event listeners as passive, which is shown for the core/assets/vendor/jquery/jquery.min.js file and its a.addEventListener(n,g) line.

When I add {passive: true} to that line (a.addEventListener(n,g,{passive: true})), some elements on the website using jQuery stop to work.

How do I safely mark the listener as passive and keep it working?

I am using Drupal 8.7.3.

javascript – Como prevenir um event listener globalmente?

criei um event listener em App.js com o seguinte:

useEffect(() => {
  window.addEventListener("scroll", e => {
    scrollToSection_DataLayer('#section1');
    scrollToSection_DataLayer('#section2');
  });
}, ());

Essas são funções externas que são executadas ao dar scroll (comportamento esperado).
Porém, em outro arquivo, possuo anchors que provocam o scroll da landing-page e logicamente disparam as funções do useEffect acima. Mas eu não gostaria que isso acontecesse. Há alguma forma de eu prevenir por um tempo, de fora do App.js, que essas funções do useEffect que estão no App.js não sejam disparadas ao clicar nos anchors?

windows – Oracle 19c listener stops on connection TNS-12541 error

I have just installed Oracle 19c Standard Edition 2 on Windows 10 and created a local database.

I can connect to it with sqlplus / sysdba, but if I try to connect with sqlplus user/password@host:port, the listener automatically stops and results in ORA-12537 error. Then lsnrctl status shows TNS 12541 error. I can restart the listener with lsnrctl startmanually, but it stops again if I try to connect.

I have tried

  1. Changing HOST to 127.0.0.1, localhost or name of PC
  2. Deleting and recreating the listener with Net Configuration Assistant
  3. Re-installing oracle
  4. Deleting log file, disable DIAG_ADR ins ora files
  5. Re-starting the services
  6. Editing HOSTS file, add oracle path to Windows system variables

But same error still appears.

The error log (It wasn’t fully in English, so I used machine translation)

PS C:Windowssystem32> sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 9 09:30:45 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. all rights reserved.


Connect to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> exit
From Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0 Disconnect
PS C:Windowssystem32> lsnrctl status

LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 09-Jun-2021 09:33:04

Copyright (c) 1991, 2019, Oracle. all rights reserved.

is connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LAPTOP)(PORT=1521)))
LISTENER STATUS
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 19.0.0.0.0 - Production
Start date 09-Jun-2021 09:14:58
Uptime 0 days 0 hours 18 minutes 9 seconds
Tracking level off
Security ON: Local OS Authentication
SNMP OFF
Listener parameter file D:ProgramOraclenetworkadminlistener.ora
Listener log file D:ProgramOraclenetworkloglistener.log
Listening endpoint summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=LAPTOP)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=. pipeEXTPROC1521ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=LAPTOP)(PORT=5500))(SECURITY=(my_wallet_directory=D:PROGRAMadminorclxdb_ wallet))(Presentation=HTTP)(Session=RAW))
Service Summary...
The service "CLRExtProc" contains 1 instance.
  Instance "CLRExtProc", status UNKNOWN, contains 1 handler for this service...
Service "orcl" contains 1 instance.
  Instance "orcl", status READY, contains 1 handler for this service...
Service "orclXDB" contains 1 instance.
  Instance "orcl", status READY, contains 1 handler for this service...
Command executed successfully
PS C:Windowssystem32> sqlplus sys/123456@localhost:1521/orcl

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jun 9 09:33:45 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.

ERROR:
ORA-12537: TNS: Connection closed


Please enter the username: sys as sysdba
Enter the password:

Connect to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> exit
From Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.3.0.0.0 Disconnect
PS C:Windowssystem32> lsnrctl status

LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 09-Jun-2021 09:36:15

Copyright (c) 1991, 2019, Oracle. all rights reserved.

is connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LAPTOP)(PORT=1521)))
TNS-12541: TNS: No listener
 TNS-12560: TNS: Protocol adapter error
  TNS-00511: No listener
   64-bit Windows Error: 61: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS: No listener
 TNS-12560: TNS: Protocol adapter error
  TNS-00511: No listener
   64-bit Windows Error: 2: No such file or directory

listener.ora:

# listener.ora Network Configuration File: D:ProgramOracleNETWORKADMINlistener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:ProgramOracle)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:ProgramOraclebinoraclr19.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

DIAG_ADR_ENABLED_LISTENER = OFF

tnsnames.ora:

# tnsnames.ora Network Configuration File: D:ProgramOracleNETWORKADMINtnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )


sqlnet.ora:

# sqlnet.ora Network Configuration File: D:ProgramOracleNETWORKADMINsqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to 
# install "Software Only", this file wont exist and without the native 
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

DIAG_ADR_ENABLED = OFF

HOSTS:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1   localhost   LAPTOP
::1             localhost

Add event listener to modal close

In Drupal we can open a modal is two ways, either with HTML:

<a class="use-ajax profile-page-link" data-dialog-type="modal" href="http://drupal.stackexchange.com/node/1" data-dialog-options="{&quot;width&quot;:800}">Open Modal</a>

Or with JS:

let ajaxSettings = {
  url: 'node/1',
  dialogType: 'modal',
  dialog: { width: 800 },
};
let ajaxObject = Drupal.ajax(ajaxSettings);
ajaxObject.execute();

Once the modal is open I would like to attach an event to the close button so I can drop a cookie on the close event to show the visitor has seen the modal and not show it to them again.

The close button has the class ui-dialog-titlebar-close but this is added after the initial page load so to attach an event we would need a dynamic click handler such as:

$('body').on('click', '.ui-dialog-titlebar-close', function() {
    alert('close button was clicked 2');
});

However this event never fires. This ctools issue mentions the same thing and has a solution involving binding to the CToolsCloseModalBehaviors event, however that was 6 years ago and I’m using D9 with no ctools so need to find a new solution.

When I inspect the attached events on the close button I can see jquery.ui/ui/widget-min.js r() and an anonymous function in jquery.min.js. Using non minified vs would help but not sure how to do that?

sql server – Still can’t create an AAG listener

I just built a test cluster with 2 MS SQL Server 2014 machines, 1 domain controller, an 1 file share witness. (All of them are Windows2016-based.)
The 2 MS SQL Server machines are a WSFC members.

When I created the Always On Availability Group, all steps succeeded except creating a listener.

If I try to repeat adding a listener to this AAG, I receive a message:

Cluster network name resource ‘myaag_mylistener’ failed to create its
associated computer object in domain ‘mydomain.lan’ during: Resource
online.

The text for the associated error code is: Access is denied.

Please work with your domain administrator to ensure that:

  • The cluster identity ‘MYWSFC$’ has Create Computer Objects permissions. By default all computer objects are created in the same
    container as the cluster identity ‘MYWSFC$’.
  • The quota for computer objects has not been reached.
  • If there is an existing computer object, verify the Cluster Identity ‘MYWSFC$’ has ‘Full Control’ permission to that computer object using
    the Active Directory Users and Computers tool.

What I tried:

  1. Create a computer object: mydomain.lan/Computers/mylistener and give the mydomainMYWSFC$ “Full control” on it;
  2. Remove the object mydomain.lan/Computers/mylistener and grant the mydomainMYWSFC$ account permissions to create computer objects within mydomain.lan/Computers (List contents, Read all properties, Read permissions, Create computer objects);
  3. In ADSI Edit, DC=mydomain,DC=lan: ms-DS-MachineAccountQuota raised from 10 to 15 (although there are only 5 machine accounts including mylistener$).

What could still be wrong?

SQL Server Basic Availability group: one or zero listener for multiple AG

In my testing of SQL Server Basic Availiiblity Group, I successfully created AG1 for DB1 and AG2 for DB2 with only AG1 config’ed with listener IP. But when I use sqlcmd to test, I can connect to AG1’s listener and use AG2’s DB, do DDL and DML. Is it OK for this configuration? Only 1 listener for several AG.

Besides, I’m using pacemaker for cluster management, is it possible to config no listener for AG, just use pacemaker’s IP resource to bind IP on master server?

reactjs – React Bootstrap component (Form.Control) OnChange event listener doesn’t fire when select all text and delete

I am using Form.Control in form , and when changing the input , I use onChange event listener, to handle the change
as in this snapshot :

<Form.Control
      className="form-control"
      type="text"
      id={props.id}
      defaultValue={props.placeholder}
      onChange={(e) => {
        updateInput(e);
      }}
></Form.Control>

all changes work fine , adding chars , deleting ,,etc ,
But when => Select ALL text and hit backspace , onChange event Listener , isn’t fired !
ps : selecting part of the text and deleting it , fires the onChange .

SPN for Availability group(AG) listener for SQL Server 2016

If you configure the listerner with a domain admin account it should be automatic but usually it is not enough.

It’s better to have full control of what you are doing.
First thing to remember is that an spn is a registration done on the domanin compunter account or domain user account that is running sql server service. While it is the same for both nodes, you have to do only one registration.

Check existing spn for your system:

setspn -L domainsqlserverservicelogin

or

setspn -L domainclusterservercumputeraccount$

Then you can register a listener in this way:

setspn -S MSSQLSvc/listener_name:port domainsqlserverservicelogin
setspn -S MSSQLSvc/listener_name.domain.local:port domainsqlserverservicelogin

It’s better to register both listener name and listener FQDN to be sure to match less precise application configurations.

The same commands with computer accounts:

setspn -S MSSQLSvc/listener_name:port clusterservercumputeraccount$
setspn -S MSSQLSvc/listener_name.domain.local:port clusterservercumputeraccount$

To register spn you have to be domain admin.

A Microsoft tool that can help you if Microsoft Kerberos Configuration Manager for SQL Server:

https://www.microsoft.com/en-us/download/details.aspx?id=39046

Once everything is on place you don’t have to do anyting else unless you change something like serfice users, listener names and/or ports

godot – Can I have an Area affect the audio imput of a Listener rather than the audio output of a speaker

Simple 3D use case, I have a Listener attached to my 3P character, and a speaker attached to the environment providing general background ambience (no attenuation.) When for example the character goes underwater I’d like the environmental noise to be muffled. When they enter a building I’d like echo, etc.