问:
Multithreaded paging query database Caused by ：java.sql.SQLException: GC overhead limit exceeded
enter image description here
1、First, I will paginate the order_id from this table
2、After getting the order_id, check the data in this table
The reason for this check is to ensure that the billing of each order is complete，But I ran into a problem when I did this, and it's as follows

```<code>2022-12-15 11:16:52.798 [,] [master housekeeper] WARN  com.zaxxer.hikari.pool.HikariPool - master - Thread starvation or clock leap detected (housekeeper delta=1m344ms).
Exception in thread "RiskOverdueBusiness-1" org.springframework.dao.TransientDataAccessResourceException:
### Error querying database.  Cause: java.sql.SQLException: GC overhead limit exceeded
### The error may exist in qnvip/data/overview/mapper/risk/RiskOverdueBaseMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT  id,renew_term,deleted,count_day,order_id,order_no,mini_type,repay_date,real_repay_time,platform,finance_type,term,risk_level,risk_strategy,audit_type,forced_conversion,discount_return_amt,rent_total,buyout_amt,act_buyout_amt,buyout_discount,overdue_fine,bond_amt,before_discount,total_discount,bond_rate,is_overdue,real_capital,capital,repay_status,overdue,real_repay_time_status,renew_total_rent,max_term,hit_value,renew_status,renew_day,surplus_bond_amt,actual_supply_price,is_settle,order_status,current_overdue_days,surplus_amt,overdue_day,term_overdue_days,renew_type,is_deleted,version,create_time,update_time  FROM dataview_risk_overdue_base   WHERE  is_deleted=0  AND (overdue_day = ?)
### Cause: java.sql.SQLException: GC overhead limit exceeded
; GC overhead limit exceeded; nested exception is java.sql.SQLException: GC overhead limit exceeded
    at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:110)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:88)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
    at com.sun.proxy.$Proxy142.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:173)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
    at com.sun.proxy.$Proxy212.selectList(Unknown Source)
    at com.baomidou.mybatisplus.extension.service.IService.list(IService.java:279)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl.getListByOrderId(RiskOverdueBaseServiceImpl.java:61)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$FastClassBySpringCGLIB$$31ab1dda.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$EnhancerBySpringCGLIB$$e7698a08.getListByOrderId(<generated>)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.oldRepayTask(RiskOverdueBusinessNew.java:95)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.lambda$execOldData$1(RiskOverdueBusinessNew.java:82)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: GC overhead limit exceeded
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy481.query(Unknown Source)
    at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:69)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
    at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:165)
    at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    at com.sun.proxy.$Proxy480.query(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
    ... 18 more
2022-12-15 11:17:12.040 [,] [slave housekeeper] WARN  com.zaxxer.hikari.pool.HikariPool - slave - Thread starvation or clock leap detected (housekeeper delta=59s747ms).
Exception in thread "RiskOverdueBusiness-5" org.springframework.dao.TransientDataAccessResourceException:
### Error querying database.  Cause: java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
### The error may exist in qnvip/data/overview/mapper/risk/RiskOverdueBaseMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters

### Cause: java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
; Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.; nested exception is java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
    at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:110)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at com.sun.proxy.$Proxy142.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:173)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
    at com.sun.proxy.$Proxy212.selectList(Unknown Source)
    at com.baomidou.mybatisplus.extension.service.IService.list(IService.java:279)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl.getListByOrderId(RiskOverdueBaseServiceImpl.java:61)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$FastClassBySpringCGLIB$$31ab1dda.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$EnhancerBySpringCGLIB$$e7698a08.getListByOrderId(<generated>)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.oldRepayTask(RiskOverdueBusinessNew.java:95)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.lambda$execOldData$1(RiskOverdueBusinessNew.java:82)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
    at sun.reflect.GeneratedMethodAccessor209.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy481.query(Unknown Source)
    at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:69)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
    at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:165)
    at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    at com.sun.proxy.$Proxy480.query(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
    at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
    ... 18 more
</code>```

I thought the query was too large to release the reference in time, but it didn't seem to work. How do I deal with exceptions to make sure that all the data gets queried
enter image description here

Body:
enter image description here
1、First, I will paginate the order_id from this table
2、After getting the order_id, check the data in this table
The reason for this check is to ensure that the billing of each order is complete，But I ran into a problem when I did this, and it's as follows

2022-12-15 11:16:52.798 [,] [master housekeeper] WARN  com.zaxxer.hikari.pool.HikariPool - master - Thread starvation or clock leap detected (housekeeper delta=1m344ms).
Exception in thread "RiskOverdueBusiness-1" org.springframework.dao.TransientDataAccessResourceException:
### Error querying database.  Cause: java.sql.SQLException: GC overhead limit exceeded
### The error may exist in qnvip/data/overview/mapper/risk/RiskOverdueBaseMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT  id,renew_term,deleted,count_day,order_id,order_no,mini_type,repay_date,real_repay_time,platform,finance_type,term,risk_level,risk_strategy,audit_type,forced_conversion,discount_return_amt,rent_total,buyout_amt,act_buyout_amt,buyout_discount,overdue_fine,bond_amt,before_discount,total_discount,bond_rate,is_overdue,real_capital,capital,repay_status,overdue,real_repay_time_status,renew_total_rent,max_term,hit_value,renew_status,renew_day,surplus_bond_amt,actual_supply_price,is_settle,order_status,current_overdue_days,surplus_amt,overdue_day,term_overdue_days,renew_type,is_deleted,version,create_time,update_time  FROM dataview_risk_overdue_base   WHERE  is_deleted=0  AND (overdue_day = ?)
### Cause: java.sql.SQLException: GC overhead limit exceeded
; GC overhead limit exceeded; nested exception is java.sql.SQLException: GC overhead limit exceeded
    at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:110)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:88)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
    at com.sun.proxy.$Proxy142.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:173)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
    at com.sun.proxy.$Proxy212.selectList(Unknown Source)
    at com.baomidou.mybatisplus.extension.service.IService.list(IService.java:279)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl.getListByOrderId(RiskOverdueBaseServiceImpl.java:61)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$FastClassBySpringCGLIB$$31ab1dda.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$EnhancerBySpringCGLIB$$e7698a08.getListByOrderId(<generated>)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.oldRepayTask(RiskOverdueBusinessNew.java:95)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.lambda$execOldData$1(RiskOverdueBusinessNew.java:82)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: GC overhead limit exceeded
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy481.query(Unknown Source)
    at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:69)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
    at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:165)
    at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    at com.sun.proxy.$Proxy480.query(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
    ... 18 more
2022-12-15 11:17:12.040 [,] [slave housekeeper] WARN  com.zaxxer.hikari.pool.HikariPool - slave - Thread starvation or clock leap detected (housekeeper delta=59s747ms).
Exception in thread "RiskOverdueBusiness-5" org.springframework.dao.TransientDataAccessResourceException:
### Error querying database.  Cause: java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
### The error may exist in qnvip/data/overview/mapper/risk/RiskOverdueBaseMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters

### Cause: java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
; Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.; nested exception is java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
    at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:110)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at com.sun.proxy.$Proxy142.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:173)
    at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
    at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
    at com.sun.proxy.$Proxy212.selectList(Unknown Source)
    at com.baomidou.mybatisplus.extension.service.IService.list(IService.java:279)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl.getListByOrderId(RiskOverdueBaseServiceImpl.java:61)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$FastClassBySpringCGLIB$$31ab1dda.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
    at qnvip.data.overview.service.risk.impl.RiskOverdueBaseServiceImpl$$EnhancerBySpringCGLIB$$e7698a08.getListByOrderId(<generated>)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.oldRepayTask(RiskOverdueBusinessNew.java:95)
    at qnvip.data.overview.business.risk.RiskOverdueBusinessNew.lambda$execOldData$1(RiskOverdueBusinessNew.java:82)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Can not read response from server. Expected to read 321 bytes, read 167 bytes before connection was unexpectedly lost.
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
    at sun.reflect.GeneratedMethodAccessor209.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy481.query(Unknown Source)
    at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:69)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
    at com.baomidou.mybatisplus.core.executor.MybatisCachingExecutor.query(MybatisCachingExecutor.java:165)
    at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    at com.sun.proxy.$Proxy480.query(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
    at sun.reflect.GeneratedMethodAccessor210.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
    ... 18 more

I thought the query was too large to release the reference in time, but it didn't seem to work. How do I deal with exceptions to make sure that all the data gets queried
enter image description here


来源: stackexchange

问:
Linear Search Within Python List
I am trying to use a linear/sequential search through a list which contains data about users. I need to search for the users by first and last name and then retrieve the remaining list data to be output to the terminal. Linear search is required for this instance as its for an assessment.

So far I have tried the below code:

```<code># Create Child Class
class child:
    def __init__(self, childfirstname, childlastname, childdob, childgender, childyearlvl, childethnicity):
            self.childfirstname = childfirstname
            self.childlastname = childlastname
            self.childdob = childdob
            self.childgender = childgender
            self.childyearlvl = childyearlvl
            self.childethnicity = childethnicity

# Create list to allow for Sequential Search

childlist = []
childlist.append(child('Bob','Jones','101015','Male','8','European'))
childlist.append(child('Sally','Fail','200115','Female','8','Maori'))

# Testing output of values stored in childlist
for obj in childlist:
  print(obj.childfirstname, obj.childlastname, obj.childdob, obj.childgender, obj.childyearlvl, obj.childethnicity, sep='  ')

print("")

#Sequential search
def search(arr, T):
    n = len(arr)#
    for i in range (0,n):
        if(arr[i] == T):
            return i
    return -1

result = search(childlist,'Bob')
output = result
if result > -1:
  print("Child found: ",childlist[output])
else:
  print("Child not found")
</code>```

I can print the values which have been appended to the list, however, I am not sure how to search for the users obj.childfirstname and obj.childlastname in one statement. Currently it cant find the 'Bob'in the list either so I am certainly doing something wrong. I also tested and found that when I print the Output, it outputs the object and not a string containing all user data. I am new to Python and would appreciate any assistance.

ContentLicense: CC BY-SA 4.0

Title: Linear Search Within Python List

Body:
I am trying to use a linear/sequential search through a list which contains data about users. I need to search for the users by first and last name and then retrieve the remaining list data to be output to the terminal. Linear search is required for this instance as its for an assessment.

So far I have tried the below code:

# Create Child Class
class child:
    def __init__(self, childfirstname, childlastname, childdob, childgender, childyearlvl, childethnicity):
            self.childfirstname = childfirstname
            self.childlastname = childlastname
            self.childdob = childdob
            self.childgender = childgender
            self.childyearlvl = childyearlvl
            self.childethnicity = childethnicity

# Create list to allow for Sequential Search

childlist = []
childlist.append(child('Bob','Jones','101015','Male','8','European'))
childlist.append(child('Sally','Fail','200115','Female','8','Maori'))

# Testing output of values stored in childlist
for obj in childlist:
  print(obj.childfirstname, obj.childlastname, obj.childdob, obj.childgender, obj.childyearlvl, obj.childethnicity, sep='  ')

print("")

#Sequential search
def search(arr, T):
    n = len(arr)#
    for i in range (0,n):
        if(arr[i] == T):
            return i
    return -1

result = search(childlist,'Bob')
output = result
if result > -1:
  print("Child found: ",childlist[output])
else:
  print("Child not found")

I can print the values which have been appended to the list, however, I am not sure how to search for the users obj.childfirstname and obj.childlastname in one statement. Currently it cant find the 'Bob'in the list either so I am certainly doing something wrong. I also tested and found that when I print the Output, it outputs the object and not a string containing all user data. I am new to Python and would appreciate any assistance.


问:
Product plus extra tax in Java
Can someone please explain to me how to do this?:

The getInfo() method in the Product class can display the final product price of both types. That is the getInfo() method (immediately in the Product class) can call the countPrice() method to print the total price.

The getInfo() method in the successor classes of the Product class can call its parent version (with 1 additional piece of information each - Weight or Volume) using super.getInfo().

Then, in the main class you don't have to call the countPrice() method for each product, but only getInfo().

`

```<code>public class Main {
    public static void main (String[] args) {

        Chocolate chocolate = new Chocolate("Nestle", 100,253596,100);
        System.out.println(chocolate.getInfo());
        System.out.println("Total Price: " + chocolate.countPrice());

        Wine wine = new Wine("Merlot",100,578551,750);
        System.out.println(wine.getInfo());
        System.out.println("Total Price: " +  wine.countPrice());

    }

}
</code>```

```<code>public class Product {
    String name;
    int barcode;
    double basePrice;
    private static final double productTax = 1.2;
    public Product (){

    }
    public Product(String name, double basePrice, int barcode) {
        this.name = name;
        this.barcode = barcode;
        this.basePrice = basePrice;
    }
    public double countPrice() {
        return basePrice * productTax;
    }
    public String getInfo(){
        return "Product Name: "  + name + "\n" +
                "Product Base Price: " + basePrice + "\n" +
                "Product BarCode: " + barcode;

    }

}

</code>```

`

`

```<code>public class Chocolate extends Product {
    int Weight;

    public Chocolate(String name, double basePrice, int barcode,int weight){
        super(name, basePrice, barcode);
        this.Weight = weight;
    }

    @Override
    public String getInfo() {
        return  "Chocolate Name: "  + name + "\n" +
                "Chocolate Base Price: " + basePrice + "\n" +
                "Chocolate Weight: " + Weight + "g\n" +
                "Chocolate BarCode: " + barcode;

    }

}
</code>```

```<code>public class Wine extends Product  {

    int Volume;
    public static final  double alcoholtax = 1.1;

    public Wine(String name, double basePrice, int barcode,int Volume){
        super(name, basePrice, barcode);
        this.Volume = Volume;
    }

    @Override
    public String getInfo() {
        return  "Wine Name: "  + name + "\n" +
                "Wine Base Price: " + basePrice + "\n" +
                "Wine Volume: " + Volume + "mL\n" +
                "Wine BarCode: " + barcode;

    }

    @Override
    public double countPrice() {
        return super.countPrice() * alcoholtax;

   }

}
</code>```

`

Can someone please explain to me how to do this?:

Title: Product plus extra tax in Java

Body:
Can someone please explain to me how to do this?:

The getInfo() method in the Product class can display the final product price of both types. That is the getInfo() method (immediately in the Product class) can call the countPrice() method to print the total price.

The getInfo() method in the successor classes of the Product class can call its parent version (with 1 additional piece of information each - Weight or Volume) using super.getInfo().

Then, in the main class you don't have to call the countPrice() method for each product, but only getInfo().

`

public class Main {
    public static void main (String[] args) {

        Chocolate chocolate = new Chocolate("Nestle", 100,253596,100);
        System.out.println(chocolate.getInfo());
        System.out.println("Total Price: " + chocolate.countPrice());

        Wine wine = new Wine("Merlot",100,578551,750);
        System.out.println(wine.getInfo());
        System.out.println("Total Price: " +  wine.countPrice());

    }

}

public class Product {
    String name;
    int barcode;
    double basePrice;
    private static final double productTax = 1.2;
    public Product (){

    }
    public Product(String name, double basePrice, int barcode) {
        this.name = name;
        this.barcode = barcode;
        this.basePrice = basePrice;
    }
    public double countPrice() {
        return basePrice * productTax;
    }
    public String getInfo(){
        return "Product Name: "  + name + "\n" +
                "Product Base Price: " + basePrice + "\n" +
                "Product BarCode: " + barcode;

    }

}

`

`

public class Chocolate extends Product {
    int Weight;

    public Chocolate(String name, double basePrice, int barcode,int weight){
        super(name, basePrice, barcode);
        this.Weight = weight;
    }

    @Override
    public String getInfo() {
        return  "Chocolate Name: "  + name + "\n" +
                "Chocolate Base Price: " + basePrice + "\n" +
                "Chocolate Weight: " + Weight + "g\n" +
                "Chocolate BarCode: " + barcode;

    }

}

public class Wine extends Product  {

    int Volume;
    public static final  double alcoholtax = 1.1;

    public Wine(String name, double basePrice, int barcode,int Volume){
        super(name, basePrice, barcode);
        this.Volume = Volume;
    }

    @Override
    public String getInfo() {
        return  "Wine Name: "  + name + "\n" +
                "Wine Base Price: " + basePrice + "\n" +
                "Wine Volume: " + Volume + "mL\n" +
                "Wine BarCode: " + barcode;

    }

    @Override
    public double countPrice() {
        return super.countPrice() * alcoholtax;

   }

}

`

Can someone please explain to me how to do this?:


问:
I have a PWA but it doesn't update the cache
I have a PWA application, but it doesn't seem to identify when there are updates. If I use CTRL+F5, it updates, but the ideal would be for the PWA to identify when there are updates.
My code:

```<code>const CACHE = "pwabuilder-precache";
const precacheFiles = [
];

self.addEventListener("install", function (event) {
  self.skipWaiting();

  event.waitUntil(
    caches.open(CACHE).then(function (cache) {
      return cache.addAll(precacheFiles);
    })
  );
});

self.addEventListener("activate", function (event) {
  event.waitUntil(self.clients.claim());
});

self.addEventListener("fetch", function (event) {
  if (event.request.method !== "GET") return;

  event.respondWith(
    fromCache(event.request).then(
      function (response) {

        event.waitUntil(
          fetch(event.request).then(function (response) {
            return updateCache(event.request, response);
          })
        );

        return response;
      },
      function () {

        return fetch(event.request)
          .then(function (response) {

            event.waitUntil(updateCache(event.request, response.clone()));

            return response;
          })
          .catch(function (error) {
            console.log("[PWA Builder] " + error);
          });
      }
    )
  );
});

function fromCache(request) {
  return caches.open(CACHE).then(function (cache) {
    return cache.match(request).then(function (matching) {
      if (!matching || matching.status === 404) {
        return Promise.reject("no-match");
      }

      return matching;
    });
  });
}

function updateCache(request, response) {
  return caches.open(CACHE).then(function (cache) {
    return cache.put(request, response);
  });
}
</code>```

I'm using a server with Node and Express.

Do the PWAs actually not update automatically, or is there an error in my code?

Body:
I have a PWA application, but it doesn't seem to identify when there are updates. If I use CTRL+F5, it updates, but the ideal would be for the PWA to identify when there are updates.
My code:

const CACHE = "pwabuilder-precache";
const precacheFiles = [
];

self.addEventListener("install", function (event) {
  self.skipWaiting();

  event.waitUntil(
    caches.open(CACHE).then(function (cache) {
      return cache.addAll(precacheFiles);
    })
  );
});

self.addEventListener("activate", function (event) {
  event.waitUntil(self.clients.claim());
});

self.addEventListener("fetch", function (event) {
  if (event.request.method !== "GET") return;

  event.respondWith(
    fromCache(event.request).then(
      function (response) {

        event.waitUntil(
          fetch(event.request).then(function (response) {
            return updateCache(event.request, response);
          })
        );

        return response;
      },
      function () {

        return fetch(event.request)
          .then(function (response) {

            event.waitUntil(updateCache(event.request, response.clone()));

            return response;
          })
          .catch(function (error) {
            console.log("[PWA Builder] " + error);
          });
      }
    )
  );
});

function fromCache(request) {
  return caches.open(CACHE).then(function (cache) {
    return cache.match(request).then(function (matching) {
      if (!matching || matching.status === 404) {
        return Promise.reject("no-match");
      }

      return matching;
    });
  });
}

function updateCache(request, response) {
  return caches.open(CACHE).then(function (cache) {
    return cache.put(request, response);
  });
}

I'm using a server with Node and Express.

Do the PWAs actually not update automatically, or is there an error in my code?


问:
Backend sub domain cookie management
I have my main domain example.com.

Subdomains:- auth.example.com, app.example.com, www.example.com

Backend:- api.example.com

Case 1 - When I server my subdomain static contents from Nginx and they make their API calls to api.example.com then NestJS (which is in api.example.com) is not able to set and read cookies even if cookie domain is set to .example.com

Case 2 - When auth.example.com, app.example.com static contents is served via NestJS like in this fashion:-

```<code>server{
    listen 80;
    server_name auth.example.com;
    location / {
    proxy_pass: http://backend ip address OR upstream address;
  }
}
</code>```

and NestJS serve sub-domain related static contents.

Then NestJS is able to set and read cookies both from their subdomains and .example.com (global scope)

Case 2 is like working as expected, but expert says "server static content from Nginx" which I also agree. But my case 1 is not working what to do. Please Help.

I want API calls should be managed by api.example.com which will also balance load and subdomains related static contents should be served by Nginx.

Title: Backend sub domain cookie management

Body:
I have my main domain example.com.

Subdomains:- auth.example.com, app.example.com, www.example.com

Backend:- api.example.com

Case 1 - When I server my subdomain static contents from Nginx and they make their API calls to api.example.com then NestJS (which is in api.example.com) is not able to set and read cookies even if cookie domain is set to .example.com

Case 2 - When auth.example.com, app.example.com static contents is served via NestJS like in this fashion:-

server{
    listen 80;
    server_name auth.example.com;
    location / {
    proxy_pass: http://backend ip address OR upstream address;
  }
}

and NestJS serve sub-domain related static contents.

Then NestJS is able to set and read cookies both from their subdomains and .example.com (global scope)

Case 2 is like working as expected, but expert says "server static content from Nginx" which I also agree. But my case 1 is not working what to do. Please Help.

I want API calls should be managed by api.example.com which will also balance load and subdomains related static contents should be served by Nginx.


问:
Why can't I establish a TCP/IP connection between my PC and a friend's PC with windows sockets? (Connection Timed Out)
So, I've been working for about 1 week and I can't establish the connection, I tried in languages like C++ and C# (I'm focused on doing it in C#) but in neither of the 2 worked.

First of all, when making or downloading these programs there is an alert: "Windows Firewall protect" but I press the Accept button. I tried all the IPv4 addresses that appeared when you type "ipconfig" in the command prompt but only with 1 of them I could make connection (which only worked on my own computer) and with the other one it doesn't even let me make the connection. I also tried with the ip that web pages give you (https://www.whatismyip.com, https://www.cual-es-mi-ip.net) but it did not work either.

When making the connection I first start the server with my friend's computer (which also accepts the Windows Firewall) and then with the same ip and port with which my friend started the server (not 127.0.0.1 or 0.0.0.0) but after a while I get the error 10060 or something related to connection timed out (https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2).

Note: All these programs are "chats".


问:
how to implement bottomsheetdialogfragment
There is a holder

```<code>public class ClientTivarHolder extends RecyclerView.ViewHolder implements View.OnClickListener{

    public TextView texttovarname,texttovarprice;

    public RoundedImageView imageTovar;

    public CardView cardTovar;

    public ItemClickListener itemClickListener;

    private Dialog dialog;

    private Context context;

    public ClientTivarHolder(View itemView){

        super(itemView);

        texttovarname=itemView.findViewById(R.id.texttovrnme);

        texttovarprice=itemView.findViewById(R.id.pricetexttovar);

        imageTovar=itemView.findViewById(R.id.tovarImage);

        cardTovar=itemView.findViewById(R.id.tovarcard);

    }

    public void setItemClickListner(ItemClickListener listner){this.itemClickListener=listner;}

    @Override

    public void onClick(View view){

        itemClickListener.onClick(view,getAdapterPosition(),false);

    }

}
</code>```

There is an adapter

```<code>public class TovarsAdapter {

    private String TovarName,TovarOpisanie,TovarPrice,TovarImage,ShopPhone,ShopUid;

    public TovarsAdapter(){

    }

    public TovarsAdapter(String tovarName, String tovarOpisanie, String tovarPrice, String tovarImage, String shopPhone, String shopUid) {

       this. TovarName = tovarName;

      this.  TovarOpisanie = tovarOpisanie;

      this.  TovarPrice = tovarPrice;

      this.  TovarImage = tovarImage;

       this. ShopPhone = shopPhone;

     this.   ShopUid = shopUid;

    }

    public String getTovarName() {

        return TovarName;

    }

    public void setTovarName(String tovarName) {

        TovarName = tovarName;

    }

    public String getTovarOpisanie() {

        return TovarOpisanie;

    }

    public void setTovarOpisanie(String tovarOpisanie) {

        TovarOpisanie = tovarOpisanie;

    }

    public String getTovarPrice() {

        return TovarPrice;

    }

    public void setTovarPrice(String tovarPrice) {

        TovarPrice = tovarPrice;

    }

    public String getTovarImage() {

        return TovarImage;

    }

    public void setTovarImage(String tovarImage) {

        TovarImage = tovarImage;

    }

    public String getShopPhone() {

        return ShopPhone;

    }

    public void setShopPhone(String shopPhone) {

        ShopPhone = shopPhone;

    }

    public String getShopUid() {

        return ShopUid;

    }

    public void setShopUid(String shopUid) {

        ShopUid = shopUid;

    }

}
</code>```

And the interface class ItemClickListener

```<code>public interface ItemClickListener {

    void onClick(View view, int position, boolean isLongClick);

}
</code>```

Activate itself where I want to implement it

```<code>public class TovarActivity extends AppCompatActivity {

private DatabaseReference tovars;

private RecyclerView recyclerView;

private String uid,srav;

    RecyclerView.LayoutManager layoutManager;

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_tovar);

        layoutManager=new GridLayoutManager(this,2);

        Log.d("Uid",getIntent().getExtras().get("ShopUid").toString());

        recyclerView=(RecyclerView) findViewById(R.id.tovarrec);

        tovars= FirebaseDatabase.getInstance().getReference().child("Tovars");

        recyclerView.setHasFixedSize(true);

        recyclerView.setLayoutManager(layoutManager);

    }

    @Override

    protected void onStart() {

        super.onStart();

        FirebaseRecyclerOptions<TovarsAdapter> options=new FirebaseRecyclerOptions.Builder<TovarsAdapter>()

                .setQuery(tovars.orderByChild("ShopUid").equalTo(getIntent().getExtras().get("ShopUid").toString()),TovarsAdapter.class).build();

        FirebaseRecyclerAdapter<TovarsAdapter, ClientTivarHolder> adapter=new FirebaseRecyclerAdapter<TovarsAdapter, ClientTivarHolder>(options) {

            @Override

            protected void onBindViewHolder( @androidx.annotation.NonNull ClientTivarHolder holder, int position,  @androidx.annotation.NonNull TovarsAdapter model) {

        holder.texttovarprice.setText(model.getTovarPrice());

        holder.texttovarname.setText(model.getTovarOpisanie());

holder.texttovarname.setHint(model.getShopUid());

                Transformation transformation=new RoundedTransformationBuilder().borderColor(Color.WHITE).borderWidthDp(3).cornerRadius(12).oval(false).build();

                Picasso.get().load(model.getTovarImage()).transform(transformation).into(holder.imageTovar);

            }

            @Override

            public ClientTivarHolder onCreateViewHolder(ViewGroup parent, int viewType) {

                View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tovars,parent,false);

              ClientTivarHolder holder=new ClientTivarHolder(view);

                return holder;

            }

        };

        recyclerView.setAdapter(adapter);

        adapter.startListening();

    }

}
</code>```

Problem: I don’t know how to make a listener on a separate item send a hint from it with a uid to receive certain information in the bottomsheetdialogfragmemt.  I tried to make a fragment manager in the holder but it didn't work out.  How can I solve my problem?

tried to make fragment manager inside holder but didn't work

Body:
There is a holder

public class ClientTivarHolder extends RecyclerView.ViewHolder implements View.OnClickListener{

    public TextView texttovarname,texttovarprice;

    public RoundedImageView imageTovar;

    public CardView cardTovar;

    public ItemClickListener itemClickListener;

    private Dialog dialog;

    private Context context;

    public ClientTivarHolder(View itemView){

        super(itemView);

        texttovarname=itemView.findViewById(R.id.texttovrnme);

        texttovarprice=itemView.findViewById(R.id.pricetexttovar);

        imageTovar=itemView.findViewById(R.id.tovarImage);

        cardTovar=itemView.findViewById(R.id.tovarcard);

    }

    public void setItemClickListner(ItemClickListener listner){this.itemClickListener=listner;}

    @Override

    public void onClick(View view){

        itemClickListener.onClick(view,getAdapterPosition(),false);

    }

}

There is an adapter

public class TovarsAdapter {

    private String TovarName,TovarOpisanie,TovarPrice,TovarImage,ShopPhone,ShopUid;

    public TovarsAdapter(){

    }

    public TovarsAdapter(String tovarName, String tovarOpisanie, String tovarPrice, String tovarImage, String shopPhone, String shopUid) {

       this. TovarName = tovarName;

      this.  TovarOpisanie = tovarOpisanie;

      this.  TovarPrice = tovarPrice;

      this.  TovarImage = tovarImage;

       this. ShopPhone = shopPhone;

     this.   ShopUid = shopUid;

    }

    public String getTovarName() {

        return TovarName;

    }

    public void setTovarName(String tovarName) {

        TovarName = tovarName;

    }

    public String getTovarOpisanie() {

        return TovarOpisanie;

    }

    public void setTovarOpisanie(String tovarOpisanie) {

        TovarOpisanie = tovarOpisanie;

    }

    public String getTovarPrice() {

        return TovarPrice;

    }

    public void setTovarPrice(String tovarPrice) {

        TovarPrice = tovarPrice;

    }

    public String getTovarImage() {

        return TovarImage;

    }

    public void setTovarImage(String tovarImage) {

        TovarImage = tovarImage;

    }

    public String getShopPhone() {

        return ShopPhone;

    }

    public void setShopPhone(String shopPhone) {

        ShopPhone = shopPhone;

    }

    public String getShopUid() {

        return ShopUid;

    }

    public void setShopUid(String shopUid) {

        ShopUid = shopUid;

    }

}

And the interface class ItemClickListener

public interface ItemClickListener {

    void onClick(View view, int position, boolean isLongClick);

}

Activate itself where I want to implement it

public class TovarActivity extends AppCompatActivity {

private DatabaseReference tovars;

private RecyclerView recyclerView;

private String uid,srav;

    RecyclerView.LayoutManager layoutManager;

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_tovar);

        layoutManager=new GridLayoutManager(this,2);

        Log.d("Uid",getIntent().getExtras().get("ShopUid").toString());

        recyclerView=(RecyclerView) findViewById(R.id.tovarrec);

        tovars= FirebaseDatabase.getInstance().getReference().child("Tovars");

        recyclerView.setHasFixedSize(true);

        recyclerView.setLayoutManager(layoutManager);

    }

    @Override

    protected void onStart() {

        super.onStart();

        FirebaseRecyclerOptions<TovarsAdapter> options=new FirebaseRecyclerOptions.Builder<TovarsAdapter>()

                .setQuery(tovars.orderByChild("ShopUid").equalTo(getIntent().getExtras().get("ShopUid").toString()),TovarsAdapter.class).build();

        FirebaseRecyclerAdapter<TovarsAdapter, ClientTivarHolder> adapter=new FirebaseRecyclerAdapter<TovarsAdapter, ClientTivarHolder>(options) {

            @Override

            protected void onBindViewHolder( @androidx.annotation.NonNull ClientTivarHolder holder, int position,  @androidx.annotation.NonNull TovarsAdapter model) {

        holder.texttovarprice.setText(model.getTovarPrice());

        holder.texttovarname.setText(model.getTovarOpisanie());

holder.texttovarname.setHint(model.getShopUid());

                Transformation transformation=new RoundedTransformationBuilder().borderColor(Color.WHITE).borderWidthDp(3).cornerRadius(12).oval(false).build();

                Picasso.get().load(model.getTovarImage()).transform(transformation).into(holder.imageTovar);

            }

            @Override

            public ClientTivarHolder onCreateViewHolder(ViewGroup parent, int viewType) {

                View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tovars,parent,false);

              ClientTivarHolder holder=new ClientTivarHolder(view);

                return holder;

            }

        };

        recyclerView.setAdapter(adapter);

        adapter.startListening();

    }

}

Problem: I don’t know how to make a listener on a separate item send a hint from it with a uid to receive certain information in the bottomsheetdialogfragmemt.  I tried to make a fragment manager in the holder but it didn't work out.  How can I solve my problem?

tried to make fragment manager inside holder but didn't work


问:
Matched Text Output Special Characters
I've been working on outputting columns of matched text between my main dataframe, and another containing 1 column of Key-texts.

I was able to not just have one column in the main dataframe showing all the matched texts, I was able to split the multiple matches into subsequent columns. however, for some reason, all my outputs contains this (refer to image):

The second image here is how it looks in the dataframe before splitting them to multiple columns:

They code below was what i used to extract out the column that holds the key-texts I am matching to:

```<code>df_key = pd.read_excel('Excel_name', sheet_name = 'Sheet_no.')
df_key = df_key.drop(columns={'All_unwanted_column_names'})
df_key = df_key.rename(columns={"Focus_column": "Keywords"})
df_key
</code>```

Afterwards I ensured all are in lower case and are string type:

```<code>import numpy as np
import re
df_key['Keywords'] = df_key['Keywords'].astype(str)
df_key['Keywords'] = df_key['Keywords'].str.lower()
</code>```

And this is the code used to match, which gave an output shown in the csv image:

```<code>regex =re.compile(f"({'|'.join(df_key.Keywords)})")
df_uns['match'] = df_uns.Longtext.str.findall(regex)
df_uns
</code>```

So my problem here is: I want to get rid of the additional """, and only show the matched-texts the program has found. I can only show partial images of my work. But if there's anything else I can provide, please let me know

Title: Matched Text Output Special Characters

Body:
I've been working on outputting columns of matched text between my main dataframe, and another containing 1 column of Key-texts.

I was able to not just have one column in the main dataframe showing all the matched texts, I was able to split the multiple matches into subsequent columns. however, for some reason, all my outputs contains this (refer to image):

The second image here is how it looks in the dataframe before splitting them to multiple columns:

They code below was what i used to extract out the column that holds the key-texts I am matching to:

df_key = pd.read_excel('Excel_name', sheet_name = 'Sheet_no.')
df_key = df_key.drop(columns={'All_unwanted_column_names'})
df_key = df_key.rename(columns={"Focus_column": "Keywords"})
df_key

Afterwards I ensured all are in lower case and are string type:

import numpy as np
import re
df_key['Keywords'] = df_key['Keywords'].astype(str)
df_key['Keywords'] = df_key['Keywords'].str.lower()

And this is the code used to match, which gave an output shown in the csv image:

regex =re.compile(f"({'|'.join(df_key.Keywords)})")
df_uns['match'] = df_uns.Longtext.str.findall(regex)
df_uns

So my problem here is: I want to get rid of the additional """, and only show the matched-texts the program has found. I can only show partial images of my work. But if there's anything else I can provide, please let me know


问:
Automatically include group/version/kind in serialized Kubernetes resource?
Given code like this:

package main

import (
    "os"

    corev1 "k8s.io/api/core/v1"
    metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    "k8s.io/apimachinery/pkg/runtime/serializer/json"
    "k8s.io/kubectl/pkg/scheme"
)

func main() {
    corev1.AddToScheme(scheme.Scheme)

    serializer := json.NewSerializerWithOptions(
        json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme,
        json.SerializerOptions{
            Pretty: true,
            Yaml:   true,
            Strict: true,
        })

    namespace := corev1.Namespace{
        ObjectMeta: metav1.ObjectMeta{
            Name: "example",
        },
    }
    if err := serializer.Encode(&namespace,
        os.Stdout); err != nil {
        panic(err)
    }
}
```
<p>Is there any way to get the serialized output to include the kind and api group/version other than providing it manually? As written, the above code produces:</p>
<pre class="lang-yaml prettyprint-override"><code>metadata:
  creationTimestamp: null
  name: example
spec: {}
status: {}
</code>```

When what I want is:

apiVersion: v1
kind: Namespace
metadata:
  creationTimestamp: null
  name: example
spec: {}
status: {}
```
<p>I realize I can do this:</p>
<pre class="lang-golang prettyprint-override"><code>namespace := corev1.Namespace{
    TypeMeta: metav1.TypeMeta{
        Kind:       "Namespace",
        APIVersion: "v1",
    },
    ObjectMeta: metav1.ObjectMeta{
        Name: "example",
    },
}
</code>```

But it seems like all the necessary metadata exists to produce this information without me having to provide it explicitly (that is, I'm already creating a corev1.Namespace object; shouldn't the g/v/k be derived directly from this type?).

Body:
Given code like this:

package main

import (
    "os"

    corev1 "k8s.io/api/core/v1"
    metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    "k8s.io/apimachinery/pkg/runtime/serializer/json"
    "k8s.io/kubectl/pkg/scheme"
)

func main() {
    corev1.AddToScheme(scheme.Scheme)

    serializer := json.NewSerializerWithOptions(
        json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme,
        json.SerializerOptions{
            Pretty: true,
            Yaml:   true,
            Strict: true,
        })

    namespace := corev1.Namespace{
        ObjectMeta: metav1.ObjectMeta{
            Name: "example",
        },
    }
    if err := serializer.Encode(&namespace,
        os.Stdout); err != nil {
        panic(err)
    }
}

Is there any way to get the serialized output to include the kind and api group/version other than providing it manually? As written, the above code produces:

metadata:
  creationTimestamp: null
  name: example
spec: {}
status: {}

When what I want is:

apiVersion: v1
kind: Namespace
metadata:
  creationTimestamp: null
  name: example
spec: {}
status: {}

I realize I can do this:

namespace := corev1.Namespace{
    TypeMeta: metav1.TypeMeta{
        Kind:       "Namespace",
        APIVersion: "v1",
    },
    ObjectMeta: metav1.ObjectMeta{
        Name: "example",
    },
}

But it seems like all the necessary metadata exists to produce this information without me having to provide it explicitly (that is, I'm already creating a corev1.Namespace object; shouldn't the g/v/k be derived directly from this type?).


问:
querying AWS kinesis to get real-time data for SageMaker predictor
I have a kinesis stream and it is sending multi-user data to a stream, what I want to do is I want to receive some information from the application I am making like the mac address, and find the latest entry for that data matching the mac address in the kinesis stream.
I want to run that data through a prediction pipeline and send results to the phone app.
is there any way to make that happen? I am new to AWS and would welcome any help or hint.</p>


问:
Inability to test the DPDK distributor application using the DPDK pktgen application in a virtual environment
I'm trying to test the DPDK distributor using the DPDK pktgen application. I tried running a pcap file on port 0 as in the image below. Although the RX from pktgen is showing, nothing is being reflected on the port 0 of the distributor application

DPDK pktgen screenshot

DPDK distributor running with no packets in rx

the results were tested by having 2 ssh sessions with the virtual machine

I'm trying to test the DPDK distributor sample application by running a pcap file using DPDK pktgen application in a virtual environment. The specifications are as follows.

The host machine specifications:

Ubuntu version: 22.04.1 LTS Jammy

Cores: 8

The virtual machine is created using KVM and the specifications are as follows:

Ubuntu version: 22.04.1 LTS Jammy

Cores: 8

Memory: 4096

DPDK version: 22.07

I use ssht from the host machine to connect with the virtual machine. I have installed both the pktgen application and compiled the distributor sample application. I have 4 ports in my virtual machine and I disabled them from the kernel and enabled them for the DPDK as follows.

```<code>sudo ifconfig enp2s0 down && sudo modprobe uio && sudo modprobe uio_pci_generic && sudo dpdk-devbind.py -b uio_pci_generic 02:00.0 && sudo dpdk-devbind.py -b uio_pci_generic 08:00.0 && sudo dpdk-devbind.py -b uio_pci_generic 09:00.0
</code>```

Then I navigated to dpdk-22.07/build/examples and started the distribtor application using.

```<code>sudo ./dpdk-distributor -l 0-4 -n 1 --file-prefix=p1 -- -p f

</code>```

on a seperate ssh session with the virtual machine. I allocated more huge pages

```<code>$ sudo -i
# echo 1536 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
/mnt# mount -t hugetlbfs pagesize=3GB /mnt/huge
</code>```

Then started the pktgen application using,

```<code>sudo pktgen -l  5-6 -n 1 --file-prefix=p2 --proc-type auto --socket-mem 256  --  -P -m "[1:3].0" -s 0:smallFlows.pcap
</code>```

But the RX for port 0 does not reflect the incoming packets from pktgen.

Body:
I'm trying to test the DPDK distributor using the DPDK pktgen application. I tried running a pcap file on port 0 as in the image below. Although the RX from pktgen is showing, nothing is being reflected on the port 0 of the distributor application

DPDK pktgen screenshot

DPDK distributor running with no packets in rx

the results were tested by having 2 ssh sessions with the virtual machine

I'm trying to test the DPDK distributor sample application by running a pcap file using DPDK pktgen application in a virtual environment. The specifications are as follows.

The host machine specifications:

Ubuntu version: 22.04.1 LTS Jammy

Cores: 8

The virtual machine is created using KVM and the specifications are as follows:

Ubuntu version: 22.04.1 LTS Jammy

Cores: 8

Memory: 4096

DPDK version: 22.07

I use ssht from the host machine to connect with the virtual machine. I have installed both the pktgen application and compiled the distributor sample application. I have 4 ports in my virtual machine and I disabled them from the kernel and enabled them for the DPDK as follows.

sudo ifconfig enp2s0 down && sudo modprobe uio && sudo modprobe uio_pci_generic && sudo dpdk-devbind.py -b uio_pci_generic 02:00.0 && sudo dpdk-devbind.py -b uio_pci_generic 08:00.0 && sudo dpdk-devbind.py -b uio_pci_generic 09:00.0

Then I navigated to dpdk-22.07/build/examples and started the distribtor application using.

sudo ./dpdk-distributor -l 0-4 -n 1 --file-prefix=p1 -- -p f

on a seperate ssh session with the virtual machine. I allocated more huge pages

$ sudo -i
# echo 1536 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
/mnt# mount -t hugetlbfs pagesize=3GB /mnt/huge

Then started the pktgen application using,

sudo pktgen -l  5-6 -n 1 --file-prefix=p2 --proc-type auto --socket-mem 256  --  -P -m "[1:3].0" -s 0:smallFlows.pcap

But the RX for port 0 does not reflect the incoming packets from pktgen.


问:
Query from property file in mongo db in spring boot application
Is it possible to read mongo db query from property file in spring boot application.

I have property file where I need to keep my all query and read the same in repository. I am able to read the data for findItemByName, I am not able do for the mongodb propagation.

Any way to read the data from property file for mongo db propagation.

```<code>public interface ItemRepository extends MongoRepository<GroceryItem, String> {
@Query(value = "GroceryItem.findItemByName")  --->Working
GroceryItem findItemByName(String name);

//@Query(value = "{category:'?0'}", fields = "{'name' : 1, 'quantity' : 1}")
@Query(value = "GroceryItem.findAll", fields="GroceryItem.findAlls")  --> Not working
List<GroceryItem> findAll(String category);

public long count();
</code>```

}

Body:
Is it possible to read mongo db query from property file in spring boot application.

I have property file where I need to keep my all query and read the same in repository. I am able to read the data for findItemByName, I am not able do for the mongodb propagation.

Any way to read the data from property file for mongo db propagation.

public interface ItemRepository extends MongoRepository<GroceryItem, String> {
@Query(value = "GroceryItem.findItemByName")  --->Working
GroceryItem findItemByName(String name);

//@Query(value = "{category:'?0'}", fields = "{'name' : 1, 'quantity' : 1}")
@Query(value = "GroceryItem.findAll", fields="GroceryItem.findAlls")  --> Not working
List<GroceryItem> findAll(String category);

public long count();

}


问:
Pyspark decimal type precision issue
I was trying to read data from oracle DB and save the data into s3 bucket. My oracle datatype is "NUMBER" and I want to bring the data as it is. While Spark default decimal-type precision is messing up my data.

I googled and tried to set the spark.sql.decimalOperations.allowPrecissionLoss to false but it doesn't seem it helped me at all. This is what I want.

```<code>spark.conf.set("spark.decimalOperations.allowPrecisionLoss", False)

data = [{"ID": 2, "how_it_is_in_oracledb": 0.721747448731, 'how_spark_currently_reading_it': 0.7217474487, 'how_i_want_spark_to_read_it': 0.721747448731},
        {"ID": 3, "how_it_is_in_oracledb": 0.721809026655, 'how_spark_currently_reading_it': 0.7218090267, 'how_i_want_spark_to_read_it': 0.721809026655},
        {"ID": 4, "how_it_is_in_oracledb": 1.11923723305, 'how_spark_currently_reading_it': 1.1192372331, 'how_i_want_spark_to_read_it': 1.11923723305},
        {"ID": 5, "how_it_is_in_oracledb": 1.4181928904, 'how_spark_currently_reading_it': 1.4181928904, 'how_i_want_spark_to_read_it': 1.4181928904},
        {"ID": 6, "how_it_is_in_oracledb": 1.722053514419, 'how_spark_currently_reading_it': 1.7220535144, 'how_i_want_spark_to_read_it': 1.722053514419}
        ]

df = spark.createDataFrame(data)
df.show(truncate=False)

+---+---------------------------+---------------------+------------------------------+
|ID |how_i_want_spark_to_read_it|how_it_is_in_oracledb|how_spark_currently_reading_it|
+---+---------------------------+---------------------+------------------------------+
|2  |0.721747448731             |0.721747448731       |0.7217474487                  |
|3  |0.721809026655             |0.721809026655       |0.7218090267                  |
|4  |1.11923723305              |1.11923723305        |1.1192372331                  |
|5  |1.4181928904               |1.4181928904         |1.4181928904                  |
|6  |1.722053514419             |1.722053514419       |1.7220535144                  |
+---+---------------------------+---------------------+------------------------------+
</code>```

Title: Pyspark decimal type precision issue

Body:
I was trying to read data from oracle DB and save the data into s3 bucket. My oracle datatype is "NUMBER" and I want to bring the data as it is. While Spark default decimal-type precision is messing up my data.

I googled and tried to set the spark.sql.decimalOperations.allowPrecissionLoss to false but it doesn't seem it helped me at all. This is what I want.

spark.conf.set("spark.decimalOperations.allowPrecisionLoss", False)

data = [{"ID": 2, "how_it_is_in_oracledb": 0.721747448731, 'how_spark_currently_reading_it': 0.7217474487, 'how_i_want_spark_to_read_it': 0.721747448731},
        {"ID": 3, "how_it_is_in_oracledb": 0.721809026655, 'how_spark_currently_reading_it': 0.7218090267, 'how_i_want_spark_to_read_it': 0.721809026655},
        {"ID": 4, "how_it_is_in_oracledb": 1.11923723305, 'how_spark_currently_reading_it': 1.1192372331, 'how_i_want_spark_to_read_it': 1.11923723305},
        {"ID": 5, "how_it_is_in_oracledb": 1.4181928904, 'how_spark_currently_reading_it': 1.4181928904, 'how_i_want_spark_to_read_it': 1.4181928904},
        {"ID": 6, "how_it_is_in_oracledb": 1.722053514419, 'how_spark_currently_reading_it': 1.7220535144, 'how_i_want_spark_to_read_it': 1.722053514419}
        ]

df = spark.createDataFrame(data)
df.show(truncate=False)

+---+---------------------------+---------------------+------------------------------+
|ID |how_i_want_spark_to_read_it|how_it_is_in_oracledb|how_spark_currently_reading_it|
+---+---------------------------+---------------------+------------------------------+
|2  |0.721747448731             |0.721747448731       |0.7217474487                  |
|3  |0.721809026655             |0.721809026655       |0.7218090267                  |
|4  |1.11923723305              |1.11923723305        |1.1192372331                  |
|5  |1.4181928904               |1.4181928904         |1.4181928904                  |
|6  |1.722053514419             |1.722053514419       |1.7220535144                  |
+---+---------------------------+---------------------+------------------------------+


问:
Create a Binary search tree by extending either Vector or Arraylist and create a method that enters elements and preserves partial ordering property
Populate and depopulate to show how it works. Check for empty and size of each structure and implement methods that perform preorderd, inordered and postordered traversels.

I am not sure on where to start. If anyone could do the entire code that would be greate. Thank you in advance.


问:
Quadratic profits depend on multi items rather than every two items of Quadratic Multi Knapsack Problem
There are multiple knapsacks that need to be filled exactly. Each knapsack has a different capacity. Items are unique. The weight of all items is 1.The value of item will be different when this item put in different knapsacks. At the same time, having multiple items in the same knapsack creates quadratic value. The quadratic value varies, depending on the type and quantity of  items in the knapsack.

Is there any kind of efficient solving techniques that can get optimal result?


问:
Script calculation Vs. multiple rows in sql results
I am using below Script to calculate the sub-price in the below form inside the sql result, but it works only in the first row result.

How can make all multiple row results can be automatic calculate by the Script respectively??

```
<pre class="snippet-code-html lang-html prettyprint-override"><code><form name="frmInvoice_details" method="post" action="" accept-charset="UTF-8">

<input type="hidden" name="tbid[]" class="txtField" value="<?php echo $row['tbid']; ?>">

<input required="required"  type="number" id="quantity"  name="quantity[]" onkeyup="calc(this)"  class="txtField" value="<?php echo $row['quantity']; ?>">

<input type="number" id="unit_price" onkeyup="calc(this)" name="unit_price[]" step="any" value="<?php echo $row['unit_price']; ?>"  required="required" />

<input type="number" id="sub_price" onkeyup="calc(this)" name="sub_price[]" step="any" value="<?php echo $row['sub_price']; ?>" readonly required="required" />

<input type="submit" name="submit" value="Submit" class="btnSubmit">
</form></code>```

Thank you for your fully support !

Body:
I am using below Script to calculate the sub-price in the below form inside the sql result, but it works only in the first row result.

How can make all multiple row results can be automatic calculate by the Script respectively??

<form name="frmInvoice_details" method="post" action="" accept-charset="UTF-8">

<input type="hidden" name="tbid[]" class="txtField" value="<?php echo $row['tbid']; ?>">

<input required="required"  type="number" id="quantity"  name="quantity[]" onkeyup="calc(this)"  class="txtField" value="<?php echo $row['quantity']; ?>">

<input type="number" id="unit_price" onkeyup="calc(this)" name="unit_price[]" step="any" value="<?php echo $row['unit_price']; ?>"  required="required" />

<input type="number" id="sub_price" onkeyup="calc(this)" name="sub_price[]" step="any" value="<?php echo $row['sub_price']; ?>" readonly required="required" />

<input type="submit" name="submit" value="Submit" class="btnSubmit">
</form>

Thank you for your fully support !


问:
Change scatter plot point colors based on thresholds on x and y axis
I basically want something similar to the image attached.

I was trying to achieve the same with scatter method of Matplotlib library. Basically I have x and y which are a list of two parameters and a third parameter lets say z which has labels for the corresponding x and y values, all (x,y,z are pandas.series object). What I plan to achieve is to color everything below y_threshold as gray and label it as not significant, everything above y_threshold but greater than x_threshold as red and labelled as up and everything above y_threshold and less than x_threshold as blue and labelled as down all of them in different color.

And also if possible have the labels from z for the top few hits.

I used the Matplotlib but didn't get the desired result. All other solutions using other libraries are also encouraged.


问:
Issues sending to multiple emails based on table column data
Here is my code :

```<code>// Set the default options for the email
$options = array(
    'sender_email'     =>  'test1@test1.com',
    'recipient_email'  =>  'test2@test2.com',
    'subject'          =>  'subject'
);
// Check the value of the "data1" column in the table
if ($insert['data1'] == 'sample1') {
  $options['recipient_email'] = 'test1@test1.com';
} elseif ($insert['data1'] == 'sample2') {
  $options['recipient_email'] = 'test2@test1.com';
}

// Send the email using the updated options
$sent_message = Form::sendMail($options);
</code>```

No matter what I do, the email is always sent to "test2@test1.com".  I have written, and rewritten a dozen different ways to the same result.  The sendMail() function is based off of the phpmailer found on PHP Form Builder.  Is there a better alternate to phpMailer?

I swapped values between emails, I wrote :

```<code>$recipientEmail = "email1.email.com";
$options = array(
    'sender_email'     =>  'test1@test1.com',
    'recipient_email'  =>  $recipientEmail,
    'subject'          =>  'subject'
);
</code>```

and wrote a loop that looked at the values of the post data, and changed the $recipientEmail corresponding to that data.

Body:
Here is my code :

// Set the default options for the email
$options = array(
    'sender_email'     =>  'test1@test1.com',
    'recipient_email'  =>  'test2@test2.com',
    'subject'          =>  'subject'
);
// Check the value of the "data1" column in the table
if ($insert['data1'] == 'sample1') {
  $options['recipient_email'] = 'test1@test1.com';
} elseif ($insert['data1'] == 'sample2') {
  $options['recipient_email'] = 'test2@test1.com';
}

// Send the email using the updated options
$sent_message = Form::sendMail($options);

No matter what I do, the email is always sent to "test2@test1.com".  I have written, and rewritten a dozen different ways to the same result.  The sendMail() function is based off of the phpmailer found on PHP Form Builder.  Is there a better alternate to phpMailer?

I swapped values between emails, I wrote :

$recipientEmail = "email1.email.com";
$options = array(
    'sender_email'     =>  'test1@test1.com',
    'recipient_email'  =>  $recipientEmail,
    'subject'          =>  'subject'
);

and wrote a loop that looked at the values of the post data, and changed the $recipientEmail corresponding to that data.


问:
ForeignKey form search via Text as opposed to Drop-Down - Django
I am working on a flight booking website on Django. In my models.py, I have two models; one called Airport and one called Flight. The Flight class has two variable's called 'Departure' and 'Destination' which inherit from from the Airport class via a foreign key.

Ultimately, I want the user to be able to select a departing airport and a destination airport. Now,I am limited to the drop-down option when trying to query airports.

Can someone please explain a way to go about editing my form to where a user can type in an airport name and the stored values will appear based on the users search. (ex: A user enters "los " and "Los Angeles" appears and can be selected.

Models.py

```<code>from django.db import models

class Airport(models.Model):
    city = models.CharField(max_length=50)
    code = models.CharField(max_length=3)

    def __str__(self):
        return f"{self.city} ({self.code})"

class Flight(models.Model):
    origin = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name="origin")
    destination = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name="destination")
    length = models.IntegerField(null=False)

    def __str__(self):
        return f"{self.id} - {self.origin} to {self.destination}"
</code>```

Below, in my forms.py file; I have added a widget dict which has allowed me to now enter in a value to the form as opposed to having a drop down menu. However, it does not suggest results based on the search nor does it prompt any of the stored airports.

Forms.py

```<code>from django import forms
from .models import Airport, Flight
from django.forms import CharField

class citySearch(forms.ModelForm):
    class Meta:
        model = Flight
        fields = ['origin', 'destination']
        widgets = {
            "origin": forms.TextInput,
            "destination": forms.TextInput
        }

</code>```

Below, in my views.py; I know there's some odd code in here but I'm leaving it for the sake of there being no "bugs".

views.py

```<code>from django.shortcuts import render
from .models import Airport, Flight
from .forms import citySearch

def index(request):
    airports = Airport.objects.all()
    context ={
        "airports": airports,
    }
    return render(request, "base/index.html" , context)

def book(request):
    form = citySearch()
    context = {
        "form": form,
    }
    if request.method == 'POST':
        form = citySearch(request.POST)
        if form.is_valid():
            form.save()
        context = {"form": form}
    return render(request, "base/book.html" , context)
</code>```

Lastly is my HTML file. Just adding it in case!

index.html

```<code><!DOCTYPE html>
<html>
    <head>
        <title> Flights </title>
    </head>
    <body>
        <form method='POST' action="{% url 'book' %}"> {% csrf_token %}
            <p>{{ form }}</p>

            <input type="submit" value ='Search'/>
        </form>
        <h3> Finding flights</h3>
        <h1> from {{ departure }} to {{destination}}</h1>
    </body>
</html>
</code>```

I hope this was clear. I did not think this would be so difficult.

I feel like I have tried everything but then again everything I have looked at has been different and hard to apply to my exact case.

Body:
I am working on a flight booking website on Django. In my models.py, I have two models; one called Airport and one called Flight. The Flight class has two variable's called 'Departure' and 'Destination' which inherit from from the Airport class via a foreign key.

Ultimately, I want the user to be able to select a departing airport and a destination airport. Now,I am limited to the drop-down option when trying to query airports.

Can someone please explain a way to go about editing my form to where a user can type in an airport name and the stored values will appear based on the users search. (ex: A user enters "los " and "Los Angeles" appears and can be selected.

Models.py

from django.db import models

class Airport(models.Model):
    city = models.CharField(max_length=50)
    code = models.CharField(max_length=3)

    def __str__(self):
        return f"{self.city} ({self.code})"

class Flight(models.Model):
    origin = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name="origin")
    destination = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name="destination")
    length = models.IntegerField(null=False)

    def __str__(self):
        return f"{self.id} - {self.origin} to {self.destination}"

Below, in my forms.py file; I have added a widget dict which has allowed me to now enter in a value to the form as opposed to having a drop down menu. However, it does not suggest results based on the search nor does it prompt any of the stored airports.

Forms.py

from django import forms
from .models import Airport, Flight
from django.forms import CharField

class citySearch(forms.ModelForm):
    class Meta:
        model = Flight
        fields = ['origin', 'destination']
        widgets = {
            "origin": forms.TextInput,
            "destination": forms.TextInput
        }

Below, in my views.py; I know there's some odd code in here but I'm leaving it for the sake of there being no "bugs".

views.py

from django.shortcuts import render
from .models import Airport, Flight
from .forms import citySearch

def index(request):
    airports = Airport.objects.all()
    context ={
        "airports": airports,
    }
    return render(request, "base/index.html" , context)

def book(request):
    form = citySearch()
    context = {
        "form": form,
    }
    if request.method == 'POST':
        form = citySearch(request.POST)
        if form.is_valid():
            form.save()
        context = {"form": form}
    return render(request, "base/book.html" , context)

Lastly is my HTML file. Just adding it in case!

index.html

<!DOCTYPE html>

        <title> Flights </title>

        <form method='POST' action="{% url 'book' %}"> {% csrf_token %}

{{ form }}

            <input type="submit" value ='Search'/>
        </form>

 Finding flights

 from {{ departure }} to {{destination}}

I hope this was clear. I did not think this would be so difficult.

I feel like I have tried everything but then again everything I have looked at has been different and hard to apply to my exact case.


问:
Why does ssh fingerprint change?
I host a gitlab in docker on my home lab.

```<code>gitlab:
    image: "gitlab/gitlab-ee:latest"
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        gitlab_rails['gitlab_ssh_host'] = "gitlab-ssh.xxx"
    ports:
      - "40080:80"
      - "40022:22"
</code>```

I found that the ssh fingerprint is incorrect.
When I connect to gitlab using ssh, the ssh fingerprint displayed is

```<code>ssh git@gitlab-ssh.xxx
ED25519 key fingerprint is SHA256:kKIZJDhaUVz/i7EzD7U/eXSoMbpNjd0oe2+HTFpfyBY
</code>```

But the ssh fingerprint shown on the gitlab page is

```<code>SHA256:eN+NZysTvGg1Z5kXaCXwpkINMD7Bv4tpWuMuhoNdhR4
</code>```

On gitlab docker container, same as the gitlab page.

```<code>SHA256:eN+NZysTvGg1Z5kXaCXwpkINMD7Bv4tpWuMuhoNdhR4
</code>```

Here is a similar question, but there is no great answer.

Title: Why does ssh fingerprint change?

Body:
I host a gitlab in docker on my home lab.

gitlab:
    image: "gitlab/gitlab-ee:latest"
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        gitlab_rails['gitlab_ssh_host'] = "gitlab-ssh.xxx"
    ports:
      - "40080:80"
      - "40022:22"

I found that the ssh fingerprint is incorrect.
When I connect to gitlab using ssh, the ssh fingerprint displayed is

ssh git@gitlab-ssh.xxx
ED25519 key fingerprint is SHA256:kKIZJDhaUVz/i7EzD7U/eXSoMbpNjd0oe2+HTFpfyBY

But the ssh fingerprint shown on the gitlab page is

SHA256:eN+NZysTvGg1Z5kXaCXwpkINMD7Bv4tpWuMuhoNdhR4

On gitlab docker container, same as the gitlab page.

SHA256:eN+NZysTvGg1Z5kXaCXwpkINMD7Bv4tpWuMuhoNdhR4

Here is a similar question, but there is no great answer.


问:
Is there a way to add the same custom payload to every intents in google dialogflow es?
I want to add custom payload to every intents to identify the type of two chatbots for analytics with biqquery. They are currently separated by region, so there is no tag for distinguishing these two bots in json files when exporting. Is there a way to add the same custom payload to every intents in google dialogflow es without adding them manually?</p>


问:
Getting the error #include errors detected. Please update your includePath
I am getting these errors :

#include errors detected. Please update your includePath  cannot open source file "iostream

I am unsure why. Here is my code

```<code>#include <iostream>

int main()
{
   std::cout << "Hello world!";
   return 0;
}
</code>```

I am new to C++ so  tried re writing it to see if there was an issue there, uninstalling and reinstalling the C++ extension on VS Code, it was running before so i have no clue what is wrong.

Body:
I am getting these errors :

#include errors detected. Please update your includePath  cannot open source file "iostream

I am unsure why. Here is my code

#include <iostream>

int main()
{
   std::cout << "Hello world!";
   return 0;
}

I am new to C++ so  tried re writing it to see if there was an issue there, uninstalling and reinstalling the C++ extension on VS Code, it was running before so i have no clue what is wrong.


问:
akka grpc server stream cannot return every result in real time
First of all, I have a server stream method. In the method, I will request an actor in a loop. I expect that after each request is responded, the application will return the result to the caller. But no, I found that it still waits for all responses to be completed before returning, is this normal?

```<code>// The code is as follows, for the convenience of observing the results, I added sleep
override def itKeepsReplying(in: HelloRequest): Source[HelloReply, NotUsed] = {
    Source(1 to 10).map(index => {
        Thread.sleep(5000)
        HelloReply(character.toString)
    })

}
</code>```

In order to confirm whether grpc itself supports, I tried java's implementation of this piece，

If you want to send data to the caller： responseObserver.onNext(responseBuilder.build());,

If you want to end this call： responseObserver.onCompleted(); ,

Data is sent to the caller every time onNext is called.

So my question is:

Is my assumption correct? If akka-grpc can do it

If it can be done, please give an example

Body:
First of all, I have a server stream method. In the method, I will request an actor in a loop. I expect that after each request is responded, the application will return the result to the caller. But no, I found that it still waits for all responses to be completed before returning, is this normal?

// The code is as follows, for the convenience of observing the results, I added sleep
override def itKeepsReplying(in: HelloRequest): Source[HelloReply, NotUsed] = {
    Source(1 to 10).map(index => {
        Thread.sleep(5000)
        HelloReply(character.toString)
    })

}

In order to confirm whether grpc itself supports, I tried java's implementation of this piece，

If you want to send data to the caller： responseObserver.onNext(responseBuilder.build());,

If you want to end this call： responseObserver.onCompleted(); ,

Data is sent to the caller every time onNext is called.

So my question is:

Is my assumption correct? If akka-grpc can do it

If it can be done, please give an example


问:
Logout from other devices in Laravel
I have a laravel system that has four different guards. I am intended to log out from all other devices if a user login from a new device or every login. I want to destroy all other previous sessions. I have tried all the suggestions found on the internet. Can anyone help me out with this issue?

```<code>if(Auth::guard('super_admin')->attempt($validated_data)) {
    Auth::guard('super_admin')->logoutOtherDevices($validated_data['password']);
    $request->session()->regenerate();
    return redirect()->route('super_admin_dashboard')->withSuccess('Login as Super Admin is Successful');
}
</code>```

I have tried something like this. It works fine for login and changes the hash password in the database. But it remains logged on other devices.

Title: Logout from other devices in Laravel

Body:
I have a laravel system that has four different guards. I am intended to log out from all other devices if a user login from a new device or every login. I want to destroy all other previous sessions. I have tried all the suggestions found on the internet. Can anyone help me out with this issue?

if(Auth::guard('super_admin')->attempt($validated_data)) {
    Auth::guard('super_admin')->logoutOtherDevices($validated_data['password']);
    $request->session()->regenerate();
    return redirect()->route('super_admin_dashboard')->withSuccess('Login as Super Admin is Successful');
}

I have tried something like this. It works fine for login and changes the hash password in the database. But it remains logged on other devices.


问:
i tried running a leaf mailer source code i found here and i got the error below please how can i run php leafmailer on local host
PHP Warning:  session_start(): Session cannot be started after headers have already been sent in C:\Users\Hp\Desktop\work\Leaf php mailer\leaf sample 1.php on line 9

To run leafmailer on local host for project


问:
Standard library/`toolz` equivalent of basic Python functions to convert arguments into interables and vice-versa
I am learning how to properly use toolz and I am looking for something equivalent to:

apply_tuple = lambda f: lambda *args: f(args)
unpack_tuple = lambda f: lambda args: f(*args)
```
<p>However I cannot find an equivalent in the standard library nor in <code>toolz</code>.</p>
<p>Context to avoid XY Problem:</p>
<p>I am trying to write a function that add two numbers using Tacit Programming style</p>
<p>So far I have:</p>
<pre class="lang-py prettyprint-override"><code>import toolz as tz
import operator

successor = tz.curry(operator.add)(1)

assert successor(0) == 1
assert successor(10) == 11

apply_tuple = lambda f: lambda *args: f(args)
unpack_tuple = lambda f: lambda args: f(*args)

addition = tz.compose(
    unpack_tuple(tz.pipe),
    tz.juxt(
        apply_tuple(tz.compose(tz.curry(tz.iterate)(successor), tz.first)),
        apply_tuple(tz.compose(tz.curry(tz.nth), tz.last)),
    )
)

assert addition(1, 0) == 1
assert addition(0, 0) == 0
assert addition(0, 1) == 1
assert addition(10, 10) == 20
</code>```

The code works as expected but I would like to replace the apply_tuple and unpack_tuple with either built-in or toolz equivalents.

Alternative solutions to represent the addition function based on successor will also be considered as valid solutions.

Body:
I am learning how to properly use toolz and I am looking for something equivalent to:

apply_tuple = lambda f: lambda *args: f(args)
unpack_tuple = lambda f: lambda args: f(*args)

However I cannot find an equivalent in the standard library nor in toolz.

Context to avoid XY Problem:

I am trying to write a function that add two numbers using Tacit Programming style

So far I have:

import toolz as tz
import operator

successor = tz.curry(operator.add)(1)

assert successor(0) == 1
assert successor(10) == 11

apply_tuple = lambda f: lambda *args: f(args)
unpack_tuple = lambda f: lambda args: f(*args)

addition = tz.compose(
    unpack_tuple(tz.pipe),
    tz.juxt(
        apply_tuple(tz.compose(tz.curry(tz.iterate)(successor), tz.first)),
        apply_tuple(tz.compose(tz.curry(tz.nth), tz.last)),
    )
)

assert addition(1, 0) == 1
assert addition(0, 0) == 0
assert addition(0, 1) == 1
assert addition(10, 10) == 20

The code works as expected but I would like to replace the apply_tuple and unpack_tuple with either built-in or toolz equivalents.

Alternative solutions to represent the addition function based on successor will also be considered as valid solutions.


问:
How to create texture with 16bit depth one component in OpenGL ES3.0 on Android?
I'm working on displaying yuv pictures with OpenGL ES3.0 on Android. I convert yuv pixels to rgb in a fragment shader. At first, I need to pass yuv pixel data to OpenGL as a texture.
When the yuv data is 8 bit-depth, I program like below and it works:

    GLenum glError;
    GLuint tex_y;
    glGenTextures(1, &tex_y);
    glBindTexture(GL_TEXTURE_2D, tex_y);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    // pix_y is y component data.
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, y_width, y_height, 0, GL_LUMINANCE,GL_UNSIGNED_BYTE, pix_y);
    glGenerateMipmap(GL_TEXTURE_2D);
    glError = glGetError();
    if (glError != GL_NO_ERROR) {
        LOGE(TAG, "y, glError: 0x%x", glError);
    }
```
<p>However there are some yuv formats with more depth like YUV420P10le. I don't want to lose the benefit of more depth, so I convert yuv data which has more than 8 bit depth to 16 bit by shifting data (for example: yuv420p10le, y_new = y_old << 6)。 Now I want to generate a 16 bit depth texture, but I always fail <code>GL_INVALID_OPERATION</code>. Below is the code to create a 16 bit texture:</p>
<pre class="lang-cpp prettyprint-override"><code>// rest part is the same with 8 bit texture.
glTexImage2D(GL_TEXTURE_2D, 0, GL_R16UI, y_width, y_height, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, pix_y);
</code>```

I've tried many format combinations in https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml, none of them succeed.

By the way, I also tested on MacOS OpenGL 3.3 and succeeded, I just need to pass data as one channel data of RGB..

// Code on MacOS OpenGL3.3. The data format depends on y depth, GL_UNSIGNED_BYTE or
// GL_UNSIGNED_SHORT. Using this config, I can access the data in RED channel of textures
// which is normalized to [0.0f, 1.0f]. However, this config doesn't work on OpenGL ES3.0
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, y_width, y_height, 0, GL_RED, dataFormat, y);

```

Body:
I'm working on displaying yuv pictures with OpenGL ES3.0 on Android. I convert yuv pixels to rgb in a fragment shader. At first, I need to pass yuv pixel data to OpenGL as a texture.
When the yuv data is 8 bit-depth, I program like below and it works:

    GLenum glError;
    GLuint tex_y;
    glGenTextures(1, &tex_y);
    glBindTexture(GL_TEXTURE_2D, tex_y);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    // pix_y is y component data.
    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, y_width, y_height, 0, GL_LUMINANCE,GL_UNSIGNED_BYTE, pix_y);
    glGenerateMipmap(GL_TEXTURE_2D);
    glError = glGetError();
    if (glError != GL_NO_ERROR) {
        LOGE(TAG, "y, glError: 0x%x", glError);
    }

However there are some yuv formats with more depth like YUV420P10le. I don't want to lose the benefit of more depth, so I convert yuv data which has more than 8 bit depth to 16 bit by shifting data (for example: yuv420p10le, y_new = y_old << 6)。 Now I want to generate a 16 bit depth texture, but I always fail GL_INVALID_OPERATION. Below is the code to create a 16 bit texture:

// rest part is the same with 8 bit texture.
glTexImage2D(GL_TEXTURE_2D, 0, GL_R16UI, y_width, y_height, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, pix_y);

I've tried many format combinations in https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml, none of them succeed.

By the way, I also tested on MacOS OpenGL 3.3 and succeeded, I just need to pass data as one channel data of RGB..

// Code on MacOS OpenGL3.3. The data format depends on y depth, GL_UNSIGNED_BYTE or
// GL_UNSIGNED_SHORT. Using this config, I can access the data in RED channel of textures
// which is normalized to [0.0f, 1.0f]. However, this config doesn't work on OpenGL ES3.0
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, y_width, y_height, 0, GL_RED, dataFormat, y);