问:
Azure Function: EfCore: Unable to cast object of type DiagnosticsLogger to type IRelationalCommandDiagnosticsLogger
While upgrading a solution from .netcore 3.1 to 6.0 (and running fine in the APIs), the following error is now thrown after each ef-core query in a Function:

```<code> System.Private.CoreLib: Exception while executing function: AutoMailChecker. System.Private.CoreLib: Unable to cast object of type 'Microsoft.EntityFrameworkCore.Diagnostics.Internal.DiagnosticsLogger`1[Microsoft.EntityFrameworkCore.DbLoggerCategory+Database+Command]' to type 'Microsoft.EntityFrameworkCore.Diagnostics.IRelationalCommandDiagnosticsLogger'.
</code>```

and the debug output

```<code>'func.exe' (CoreCLR: clrhost): Loaded 'C:\Users\conta\AppData\Local\AzureFunctionsTools\Releases\4.30.0\cli_x64\System.Linq.Queryable.dll'.
'func.exe' (CoreCLR: clrhost): Loaded 'C:\...\Services\EmailSmtpSender\EmailSender\bin\Debug\net6.0-windows\bin\runtimes/win/lib/net6.0/Microsoft.Data.SqlClient.dll'.
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in Microsoft.EntityFrameworkCore.Relational.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.WebJobs.Host.FunctionInvocationException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.WebJobs.Host.FunctionInvocationException' in System.Private.CoreLib.dll
</code>```

The dependencies (including transitive ones):

AutoMapper

10.1.1 Azure.Core                                                                         1.25.0 Azure.Core.Amqp                                                                    1.2.0 Azure.Extensions.AspNetCore.Configuration.Secrets                                  1.2.2 Azure.Identity                                                                     1.8.0 Azure.Messaging.ServiceBus                                                         7.11.1 Azure.Security.KeyVault.Secrets                                                    4.4.0 Azure.Storage.Blobs                                                                12.14.1 Azure.Storage.Common                                                               12.13.0 ConfigCat.Client                                                                   7.0.0 Dapper                                                                             2.0.123 DocumentFormat.OpenXml                                                             2.18.0 GemBox.Document                                                                    33.0.1031 GemBox.Pdf                                                                         17.0.1015 HarfBuzzSharp                                                                      2.6.1.7 Humanizer.Core                                                                     2.14.1 Microsoft.ApplicationInsights                                                      2.21.0 Microsoft.ApplicationInsights.AspNetCore                                           2.21.0 Microsoft.ApplicationInsights.DependencyCollector                                  2.21.0 Microsoft.ApplicationInsights.EventCounterCollector                                2.21.0 Microsoft.ApplicationInsights.PerfCounterCollector                                 2.21.0 Microsoft.ApplicationInsights.WindowsServer                                        2.21.0 Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel                       2.21.0 Microsoft.AspNet.WebApi.Client                                                     5.2.8 Microsoft.AspNetCore.Authentication.Abstractions                                   2.2.0 Microsoft.AspNetCore.Authentication.Core                                           2.2.0 Microsoft.AspNetCore.Authorization                                                 2.2.0 Microsoft.AspNetCore.Authorization.Policy                                          2.2.0 Microsoft.AspNetCore.Hosting                                                       2.1.1 Microsoft.AspNetCore.Hosting.Abstractions                                          2.2.0 Microsoft.AspNetCore.Hosting.Server.Abstractions                                   2.2.0 Microsoft.AspNetCore.Http                                                          2.2.2 Microsoft.AspNetCore.Http.Abstractions                                             2.2.0 Microsoft.AspNetCore.Http.Extensions                                               2.2.0 Microsoft.AspNetCore.Http.Features                                                 2.2.0 Microsoft.AspNetCore.JsonPatch                                                     2.2.0 Microsoft.AspNetCore.Mvc.Abstractions                                              2.2.0 Microsoft.AspNetCore.Mvc.Core                                                      2.2.0 Microsoft.AspNetCore.Mvc.Formatters.Json                                           2.2.0 Microsoft.AspNetCore.Mvc.WebApiCompatShim                                          2.2.0 Microsoft.AspNetCore.ResponseCaching.Abstractions                                  2.2.0 Microsoft.AspNetCore.Routing                                                       2.2.2 Microsoft.AspNetCore.Routing.Abstractions                                          2.2.0 Microsoft.AspNetCore.WebUtilities                                                  2.2.0 Microsoft.Azure.Amqp                                                               2.5.12 Microsoft.Azure.Functions.Analyzers                                                1.0.0 Microsoft.Azure.Services.AppAuthentication                                         1.6.2 Microsoft.Azure.WebJobs                                                            3.0.32 Microsoft.Azure.WebJobs.Core                                                       3.0.32 Microsoft.Azure.WebJobs.Extensions                                                 3.0.6 Microsoft.Azure.WebJobs.Extensions.Http                                            3.2.0 Microsoft.Azure.WebJobs.Host.Storage                                               3.0.14 Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator                         4.0.1 Microsoft.Bcl.AsyncInterfaces                                                      1.1.1 Microsoft.CSharp                                                                   4.7.0 Microsoft.Data.SqlClient                                                           5.1.0-preview2.22314.2 Microsoft.Data.SqlClient.SNI.runtime                                               5.1.0-preview2.22311.2 Microsoft.DotNet.PlatformAbstractions                                              2.1.0 Microsoft.EntityFrameworkCore.Abstractions                                         6.0.12 Microsoft.EntityFrameworkCore.Analyzers                                            6.0.12 Microsoft.EntityFrameworkCore.Relational                                           6.0.12 Microsoft.Extensions.ApiDescription.Server                                         6.0.5 Microsoft.Extensions.Caching.Abstractions                                          6.0.0 Microsoft.Extensions.Caching.Memory                                                6.0.1 Microsoft.Extensions.Configuration.Abstractions                                    6.0.0 Microsoft.Extensions.Configuration.EnvironmentVariables                            2.1.1 Microsoft.Extensions.Configuration.FileExtensions                                  3.1.0 Microsoft.Extensions.Configuration.Json                                            3.1.0 Microsoft.Extensions.DependencyInjection.Abstractions                              6.0.0 Microsoft.Extensions.DependencyModel                                               2.1.0 Microsoft.Extensions.FileProviders.Abstractions                                    3.1.0 Microsoft.Extensions.FileProviders.Physical                                        3.1.0 Microsoft.Extensions.FileSystemGlobbing                                            3.1.0 Microsoft.Extensions.Hosting                                                       2.1.0 Microsoft.Extensions.Hosting.Abstractions                                          2.2.0 Microsoft.Extensions.Logging                                                       6.0.0 Microsoft.Extensions.Logging.Abstractions                                          6.0.0 Microsoft.Extensions.Logging.ApplicationInsights                                   2.21.0 Microsoft.Extensions.Logging.Configuration                                         2.1.0 Microsoft.Extensions.ObjectPool                                                    2.2.0 Microsoft.Extensions.Options                                                       6.0.0 Microsoft.Extensions.Options.ConfigurationExtensions                               2.1.0 Microsoft.Extensions.Primitives                                                    6.0.0 Microsoft.Graph                                                                    4.49.0 Microsoft.Graph.Core                                                               2.0.14 Microsoft.Identity.Client                                                          4.47.2 Microsoft.Identity.Client.Extensions.Msal                                          2.23.0 Microsoft.IdentityModel.Abstractions                                               6.25.1 Microsoft.IdentityModel.Clients.ActiveDirectory                                    5.2.9 Microsoft.IdentityModel.JsonWebTokens                                              6.25.1 Microsoft.IdentityModel.Logging                                                    6.25.1 Microsoft.IdentityModel.Protocols                                                  6.24.0 Microsoft.IdentityModel.Protocols.OpenIdConnect                                    6.24.0 Microsoft.IdentityModel.Tokens                                                     6.25.1 Microsoft.Net.Http.Headers                                                         2.2.0 Microsoft.NETCore.Platforms                                                        3.1.0 Microsoft.NETCore.Targets                                                          1.1.3 Microsoft.OpenApi                                                                  1.2.3 Microsoft.SqlServer.Server                                                         1.0.0 Microsoft.Win32.Primitives                                                         4.3.0 Microsoft.Win32.Registry                                                           5.0.0 Microsoft.Win32.SystemEvents                                                       6.0.0 MimeKit                                                                            3.4.2 MimeMapping                                                                        1.0.1.50 ncrontab.signed                                                                    3.3.0 NETStandard.Library                                                                1.6.1 Newtonsoft.Json                                                                    13.0.2 Newtonsoft.Json.Bson                                                               1.0.1 OpenXmlPowerTools-NetStandard                                                      4.6.23-alpha4 Pkcs11Interop                                                                      5.1.1 Portable.BouncyCastle                                                              1.9.0 QRCoder                                                                            1.4.3 QRCoder.Xaml                                                                       1.4.3 runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.native.System                                                              4.3.0 runtime.native.System.IO.Compression                                               4.3.0 runtime.native.System.Net.Http                                                     4.3.0 runtime.native.System.Security.Cryptography.Apple                                  4.3.0 runtime.native.System.Security.Cryptography.OpenSsl                                4.3.2 runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple
4.3.0 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 SendGrid                                                                           9.28.1 SqlKata                                                                            2.4.0 starkbank-ecdsa                                                                    1.3.3 Swashbuckle.AspNetCore                                                             6.4.0 Swashbuckle.AspNetCore.Swagger                                                     6.4.0 Swashbuckle.AspNetCore.SwaggerGen                                                  6.4.0 Swashbuckle.AspNetCore.SwaggerUI                                                   6.4.0 System.AppContext                                                                  4.3.0 System.Buffers                                                                     4.5.1 System.Collections                                                                 4.3.0 System.Collections.Concurrent                                                      4.3.0 System.Collections.Immutable                                                       6.0.0 System.Collections.NonGeneric                                                      4.3.0 System.Collections.Specialized                                                     4.3.0 System.ComponentModel                                                              4.3.0 System.ComponentModel.Annotations                                                  4.4.0 System.ComponentModel.Primitives                                                   4.3.0 System.ComponentModel.TypeConverter                                                4.3.0 System.Configuration.ConfigurationManager                                          6.0.1 System.Console                                                                     4.3.0 System.Data.Common                                                                 4.3.0 System.Diagnostics.Debug                                                           4.3.0 System.Diagnostics.DiagnosticSource                                                6.0.0 System.Diagnostics.PerformanceCounter                                              4.7.0 System.Diagnostics.Process                                                         4.3.0 System.Diagnostics.Tools                                                           4.3.0 System.Diagnostics.TraceSource                                                     4.3.0 System.Diagnostics.Tracing                                                         4.3.0 System.Drawing.Common                                                              6.0.0 System.Dynamic.Runtime                                                             4.3.0 System.Formats.Asn1                                                                6.0.0 System.Globalization                                                               4.3.0 System.Globalization.Calendars                                                     4.3.0 System.Globalization.Extensions                                                    4.3.0 System.IdentityModel.Tokens.Jwt                                                    6.25.1 System.IO                                                                          4.3.0 System.IO.Compression                                                              4.3.0 System.IO.Compression.ZipFile                                                      4.3.0 System.IO.FileSystem                                                               4.3.0 System.IO.FileSystem.AccessControl                                                 5.0.0 System.IO.FileSystem.Primitives                                                    4.3.0 System.IO.Hashing                                                                  6.0.0 System.IO.Packaging                                                                4.7.0 System.Linq                                                                        4.3.0 System.Linq.Expressions                                                            4.3.0 System.Linq.Queryable                                                              4.3.0 System.Memory                                                                      4.5.4 System.Memory.Data                                                                 1.0.2 System.Net.Http                                                                    4.3.4 System.Net.Primitives                                                              4.3.0 System.Net.Sockets                                                                 4.3.0 System.Numerics.Vectors                                                            4.5.0 System.ObjectModel                                                                 4.3.0 System.Private.DataContractSerialization                                           4.3.0 System.Private.Uri                                                                 4.3.2 System.Reflection                                                                  4.3.0 System.Reflection.Emit                                                             4.7.0 System.Reflection.Emit.ILGeneration                                                4.3.0 System.Reflection.Emit.Lightweight                                                 4.3.0 System.Reflection.Extensions                                                       4.3.0 System.Reflection.Metadata                                                         1.6.0 System.Reflection.Primitives                                                       4.3.0 System.Reflection.TypeExtensions                                                   4.7.0 System.Resources.ResourceManager                                                   4.3.0 System.Runtime                                                                     4.3.1 System.Runtime.Caching                                                             6.0.0 System.Runtime.CompilerServices.Unsafe                                             6.0.0 System.Runtime.Extensions                                                          4.3.0 System.Runtime.Handles                                                             4.3.0 System.Runtime.InteropServices                                                     4.3.0 System.Runtime.InteropServices.RuntimeInformation                                  4.3.0 System.Runtime.Loader                                                              4.3.0 System.Runtime.Numerics                                                            4.3.0 System.Runtime.Serialization.Formatters                                            4.3.0 System.Runtime.Serialization.Json                                                  4.3.0 System.Runtime.Serialization.Primitives                                            4.3.0 System.Security.AccessControl                                                      6.0.0 System.Security.Claims                                                             4.3.0 System.Security.Cryptography.Algorithms                                            4.3.0 System.Security.Cryptography.Cng                                                   5.0.0 System.Security.Cryptography.Csp                                                   4.3.0 System.Security.Cryptography.Encoding                                              4.3.0 System.Security.Cryptography.OpenSsl                                               4.3.0 System.Security.Cryptography.Pkcs                                                  6.0.0 System.Security.Cryptography.Primitives                                            4.3.0 System.Security.Cryptography.ProtectedData                                         6.0.0 System.Security.Cryptography.X509Certificates                                      4.3.0 System.Security.Permissions                                                        6.0.0 System.Security.Principal                                                          4.3.0 System.Security.Principal.Windows                                                  5.0.0 System.Security.SecureString                                                       4.3.0 System.Text.Encoding                                                               4.3.0 System.Text.Encoding.CodePages                                                     6.0.0 System.Text.Encoding.Extensions                                                    4.3.0 System.Text.Encodings.Web                                                          6.0.0 System.Text.Json                                                                   6.0.6 System.Text.RegularExpressions                                                     4.3.1 System.Threading                                                                   4.3.0 System.Threading.Tasks                                                             4.3.0 System.Threading.Tasks.Dataflow                                                    4.8.0 System.Threading.Tasks.Extensions                                                  4.5.4 System.Threading.Thread                                                            4.3.0 System.Threading.ThreadPool                                                        4.3.0 System.Threading.Timer                                                             4.3.0 System.Windows.Extensions                                                          6.0.0 System.Xml.ReaderWriter                                                            4.3.0 System.Xml.XDocument                                                               4.3.0 System.Xml.XmlDocument                                                             4.3.0 System.Xml.XmlSerializer                                                           4.3.0 System.Xml.XPath                                                                   4.3.0 WindowsAzure.Storage                                                               9.3.1 Z.EntityFramework.Extensions.EFCore                                                6.17.1 Z.EntityFramework.Plus.EFCore                                                      6.17.1 Z.Expressions.Eval                                                                 4.0.90

Body:
While upgrading a solution from .netcore 3.1 to 6.0 (and running fine in the APIs), the following error is now thrown after each ef-core query in a Function:

 System.Private.CoreLib: Exception while executing function: AutoMailChecker. System.Private.CoreLib: Unable to cast object of type 'Microsoft.EntityFrameworkCore.Diagnostics.Internal.DiagnosticsLogger`1[Microsoft.EntityFrameworkCore.DbLoggerCategory+Database+Command]' to type 'Microsoft.EntityFrameworkCore.Diagnostics.IRelationalCommandDiagnosticsLogger'.

and the debug output

'func.exe' (CoreCLR: clrhost): Loaded 'C:\Users\conta\AppData\Local\AzureFunctionsTools\Releases\4.30.0\cli_x64\System.Linq.Queryable.dll'.
'func.exe' (CoreCLR: clrhost): Loaded 'C:\...\Services\EmailSmtpSender\EmailSender\bin\Debug\net6.0-windows\bin\runtimes/win/lib/net6.0/Microsoft.Data.SqlClient.dll'.
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in Microsoft.EntityFrameworkCore.Relational.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'System.InvalidCastException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.WebJobs.Host.FunctionInvocationException' in System.Private.CoreLib.dll
Exception thrown: 'Microsoft.Azure.WebJobs.Host.FunctionInvocationException' in System.Private.CoreLib.dll

The dependencies (including transitive ones):

AutoMapper

10.1.1 Azure.Core                                                                         1.25.0 Azure.Core.Amqp                                                                    1.2.0 Azure.Extensions.AspNetCore.Configuration.Secrets                                  1.2.2 Azure.Identity                                                                     1.8.0 Azure.Messaging.ServiceBus                                                         7.11.1 Azure.Security.KeyVault.Secrets                                                    4.4.0 Azure.Storage.Blobs                                                                12.14.1 Azure.Storage.Common                                                               12.13.0 ConfigCat.Client                                                                   7.0.0 Dapper                                                                             2.0.123 DocumentFormat.OpenXml                                                             2.18.0 GemBox.Document                                                                    33.0.1031 GemBox.Pdf                                                                         17.0.1015 HarfBuzzSharp                                                                      2.6.1.7 Humanizer.Core                                                                     2.14.1 Microsoft.ApplicationInsights                                                      2.21.0 Microsoft.ApplicationInsights.AspNetCore                                           2.21.0 Microsoft.ApplicationInsights.DependencyCollector                                  2.21.0 Microsoft.ApplicationInsights.EventCounterCollector                                2.21.0 Microsoft.ApplicationInsights.PerfCounterCollector                                 2.21.0 Microsoft.ApplicationInsights.WindowsServer                                        2.21.0 Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel                       2.21.0 Microsoft.AspNet.WebApi.Client                                                     5.2.8 Microsoft.AspNetCore.Authentication.Abstractions                                   2.2.0 Microsoft.AspNetCore.Authentication.Core                                           2.2.0 Microsoft.AspNetCore.Authorization                                                 2.2.0 Microsoft.AspNetCore.Authorization.Policy                                          2.2.0 Microsoft.AspNetCore.Hosting                                                       2.1.1 Microsoft.AspNetCore.Hosting.Abstractions                                          2.2.0 Microsoft.AspNetCore.Hosting.Server.Abstractions                                   2.2.0 Microsoft.AspNetCore.Http                                                          2.2.2 Microsoft.AspNetCore.Http.Abstractions                                             2.2.0 Microsoft.AspNetCore.Http.Extensions                                               2.2.0 Microsoft.AspNetCore.Http.Features                                                 2.2.0 Microsoft.AspNetCore.JsonPatch                                                     2.2.0 Microsoft.AspNetCore.Mvc.Abstractions                                              2.2.0 Microsoft.AspNetCore.Mvc.Core                                                      2.2.0 Microsoft.AspNetCore.Mvc.Formatters.Json                                           2.2.0 Microsoft.AspNetCore.Mvc.WebApiCompatShim                                          2.2.0 Microsoft.AspNetCore.ResponseCaching.Abstractions                                  2.2.0 Microsoft.AspNetCore.Routing                                                       2.2.2 Microsoft.AspNetCore.Routing.Abstractions                                          2.2.0 Microsoft.AspNetCore.WebUtilities                                                  2.2.0 Microsoft.Azure.Amqp                                                               2.5.12 Microsoft.Azure.Functions.Analyzers                                                1.0.0 Microsoft.Azure.Services.AppAuthentication                                         1.6.2 Microsoft.Azure.WebJobs                                                            3.0.32 Microsoft.Azure.WebJobs.Core                                                       3.0.32 Microsoft.Azure.WebJobs.Extensions                                                 3.0.6 Microsoft.Azure.WebJobs.Extensions.Http                                            3.2.0 Microsoft.Azure.WebJobs.Host.Storage                                               3.0.14 Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator                         4.0.1 Microsoft.Bcl.AsyncInterfaces                                                      1.1.1 Microsoft.CSharp                                                                   4.7.0 Microsoft.Data.SqlClient                                                           5.1.0-preview2.22314.2 Microsoft.Data.SqlClient.SNI.runtime                                               5.1.0-preview2.22311.2 Microsoft.DotNet.PlatformAbstractions                                              2.1.0 Microsoft.EntityFrameworkCore.Abstractions                                         6.0.12 Microsoft.EntityFrameworkCore.Analyzers                                            6.0.12 Microsoft.EntityFrameworkCore.Relational                                           6.0.12 Microsoft.Extensions.ApiDescription.Server                                         6.0.5 Microsoft.Extensions.Caching.Abstractions                                          6.0.0 Microsoft.Extensions.Caching.Memory                                                6.0.1 Microsoft.Extensions.Configuration.Abstractions                                    6.0.0 Microsoft.Extensions.Configuration.EnvironmentVariables                            2.1.1 Microsoft.Extensions.Configuration.FileExtensions                                  3.1.0 Microsoft.Extensions.Configuration.Json                                            3.1.0 Microsoft.Extensions.DependencyInjection.Abstractions                              6.0.0 Microsoft.Extensions.DependencyModel                                               2.1.0 Microsoft.Extensions.FileProviders.Abstractions                                    3.1.0 Microsoft.Extensions.FileProviders.Physical                                        3.1.0 Microsoft.Extensions.FileSystemGlobbing                                            3.1.0 Microsoft.Extensions.Hosting                                                       2.1.0 Microsoft.Extensions.Hosting.Abstractions                                          2.2.0 Microsoft.Extensions.Logging                                                       6.0.0 Microsoft.Extensions.Logging.Abstractions                                          6.0.0 Microsoft.Extensions.Logging.ApplicationInsights                                   2.21.0 Microsoft.Extensions.Logging.Configuration                                         2.1.0 Microsoft.Extensions.ObjectPool                                                    2.2.0 Microsoft.Extensions.Options                                                       6.0.0 Microsoft.Extensions.Options.ConfigurationExtensions                               2.1.0 Microsoft.Extensions.Primitives                                                    6.0.0 Microsoft.Graph                                                                    4.49.0 Microsoft.Graph.Core                                                               2.0.14 Microsoft.Identity.Client                                                          4.47.2 Microsoft.Identity.Client.Extensions.Msal                                          2.23.0 Microsoft.IdentityModel.Abstractions                                               6.25.1 Microsoft.IdentityModel.Clients.ActiveDirectory                                    5.2.9 Microsoft.IdentityModel.JsonWebTokens                                              6.25.1 Microsoft.IdentityModel.Logging                                                    6.25.1 Microsoft.IdentityModel.Protocols                                                  6.24.0 Microsoft.IdentityModel.Protocols.OpenIdConnect                                    6.24.0 Microsoft.IdentityModel.Tokens                                                     6.25.1 Microsoft.Net.Http.Headers                                                         2.2.0 Microsoft.NETCore.Platforms                                                        3.1.0 Microsoft.NETCore.Targets                                                          1.1.3 Microsoft.OpenApi                                                                  1.2.3 Microsoft.SqlServer.Server                                                         1.0.0 Microsoft.Win32.Primitives                                                         4.3.0 Microsoft.Win32.Registry                                                           5.0.0 Microsoft.Win32.SystemEvents                                                       6.0.0 MimeKit                                                                            3.4.2 MimeMapping                                                                        1.0.1.50 ncrontab.signed                                                                    3.3.0 NETStandard.Library                                                                1.6.1 Newtonsoft.Json                                                                    13.0.2 Newtonsoft.Json.Bson                                                               1.0.1 OpenXmlPowerTools-NetStandard                                                      4.6.23-alpha4 Pkcs11Interop                                                                      5.1.1 Portable.BouncyCastle                                                              1.9.0 QRCoder                                                                            1.4.3 QRCoder.Xaml                                                                       1.4.3 runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.native.System                                                              4.3.0 runtime.native.System.IO.Compression                                               4.3.0 runtime.native.System.Net.Http                                                     4.3.0 runtime.native.System.Security.Cryptography.Apple                                  4.3.0 runtime.native.System.Security.Cryptography.OpenSsl                                4.3.2 runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple
4.3.0 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl
4.3.2 SendGrid                                                                           9.28.1 SqlKata                                                                            2.4.0 starkbank-ecdsa                                                                    1.3.3 Swashbuckle.AspNetCore                                                             6.4.0 Swashbuckle.AspNetCore.Swagger                                                     6.4.0 Swashbuckle.AspNetCore.SwaggerGen                                                  6.4.0 Swashbuckle.AspNetCore.SwaggerUI                                                   6.4.0 System.AppContext                                                                  4.3.0 System.Buffers                                                                     4.5.1 System.Collections                                                                 4.3.0 System.Collections.Concurrent                                                      4.3.0 System.Collections.Immutable                                                       6.0.0 System.Collections.NonGeneric                                                      4.3.0 System.Collections.Specialized                                                     4.3.0 System.ComponentModel                                                              4.3.0 System.ComponentModel.Annotations                                                  4.4.0 System.ComponentModel.Primitives                                                   4.3.0 System.ComponentModel.TypeConverter                                                4.3.0 System.Configuration.ConfigurationManager                                          6.0.1 System.Console                                                                     4.3.0 System.Data.Common                                                                 4.3.0 System.Diagnostics.Debug                                                           4.3.0 System.Diagnostics.DiagnosticSource                                                6.0.0 System.Diagnostics.PerformanceCounter                                              4.7.0 System.Diagnostics.Process                                                         4.3.0 System.Diagnostics.Tools                                                           4.3.0 System.Diagnostics.TraceSource                                                     4.3.0 System.Diagnostics.Tracing                                                         4.3.0 System.Drawing.Common                                                              6.0.0 System.Dynamic.Runtime                                                             4.3.0 System.Formats.Asn1                                                                6.0.0 System.Globalization                                                               4.3.0 System.Globalization.Calendars                                                     4.3.0 System.Globalization.Extensions                                                    4.3.0 System.IdentityModel.Tokens.Jwt                                                    6.25.1 System.IO                                                                          4.3.0 System.IO.Compression                                                              4.3.0 System.IO.Compression.ZipFile                                                      4.3.0 System.IO.FileSystem                                                               4.3.0 System.IO.FileSystem.AccessControl                                                 5.0.0 System.IO.FileSystem.Primitives                                                    4.3.0 System.IO.Hashing                                                                  6.0.0 System.IO.Packaging                                                                4.7.0 System.Linq                                                                        4.3.0 System.Linq.Expressions                                                            4.3.0 System.Linq.Queryable                                                              4.3.0 System.Memory                                                                      4.5.4 System.Memory.Data                                                                 1.0.2 System.Net.Http                                                                    4.3.4 System.Net.Primitives                                                              4.3.0 System.Net.Sockets                                                                 4.3.0 System.Numerics.Vectors                                                            4.5.0 System.ObjectModel                                                                 4.3.0 System.Private.DataContractSerialization                                           4.3.0 System.Private.Uri                                                                 4.3.2 System.Reflection                                                                  4.3.0 System.Reflection.Emit                                                             4.7.0 System.Reflection.Emit.ILGeneration                                                4.3.0 System.Reflection.Emit.Lightweight                                                 4.3.0 System.Reflection.Extensions                                                       4.3.0 System.Reflection.Metadata                                                         1.6.0 System.Reflection.Primitives                                                       4.3.0 System.Reflection.TypeExtensions                                                   4.7.0 System.Resources.ResourceManager                                                   4.3.0 System.Runtime                                                                     4.3.1 System.Runtime.Caching                                                             6.0.0 System.Runtime.CompilerServices.Unsafe                                             6.0.0 System.Runtime.Extensions                                                          4.3.0 System.Runtime.Handles                                                             4.3.0 System.Runtime.InteropServices                                                     4.3.0 System.Runtime.InteropServices.RuntimeInformation                                  4.3.0 System.Runtime.Loader                                                              4.3.0 System.Runtime.Numerics                                                            4.3.0 System.Runtime.Serialization.Formatters                                            4.3.0 System.Runtime.Serialization.Json                                                  4.3.0 System.Runtime.Serialization.Primitives                                            4.3.0 System.Security.AccessControl                                                      6.0.0 System.Security.Claims                                                             4.3.0 System.Security.Cryptography.Algorithms                                            4.3.0 System.Security.Cryptography.Cng                                                   5.0.0 System.Security.Cryptography.Csp                                                   4.3.0 System.Security.Cryptography.Encoding                                              4.3.0 System.Security.Cryptography.OpenSsl                                               4.3.0 System.Security.Cryptography.Pkcs                                                  6.0.0 System.Security.Cryptography.Primitives                                            4.3.0 System.Security.Cryptography.ProtectedData                                         6.0.0 System.Security.Cryptography.X509Certificates                                      4.3.0 System.Security.Permissions                                                        6.0.0 System.Security.Principal                                                          4.3.0 System.Security.Principal.Windows                                                  5.0.0 System.Security.SecureString                                                       4.3.0 System.Text.Encoding                                                               4.3.0 System.Text.Encoding.CodePages                                                     6.0.0 System.Text.Encoding.Extensions                                                    4.3.0 System.Text.Encodings.Web                                                          6.0.0 System.Text.Json                                                                   6.0.6 System.Text.RegularExpressions                                                     4.3.1 System.Threading                                                                   4.3.0 System.Threading.Tasks                                                             4.3.0 System.Threading.Tasks.Dataflow                                                    4.8.0 System.Threading.Tasks.Extensions                                                  4.5.4 System.Threading.Thread                                                            4.3.0 System.Threading.ThreadPool                                                        4.3.0 System.Threading.Timer                                                             4.3.0 System.Windows.Extensions                                                          6.0.0 System.Xml.ReaderWriter                                                            4.3.0 System.Xml.XDocument                                                               4.3.0 System.Xml.XmlDocument                                                             4.3.0 System.Xml.XmlSerializer                                                           4.3.0 System.Xml.XPath                                                                   4.3.0 WindowsAzure.Storage                                                               9.3.1 Z.EntityFramework.Extensions.EFCore                                                6.17.1 Z.EntityFramework.Plus.EFCore                                                      6.17.1 Z.Expressions.Eval                                                                 4.0.90


来源: stackexchange

问:
ERROR in ./node_modules/react-router-dom/dist/index.js
I am using "react-router-dom": "^5.2.0" and I've isntalled it with this code npm install react-router-dom@5.2.0 But now it is showing this error message:

```<code>Compiled with problems:

ERROR in ./node_modules/react-router-dom/dist/index.js

Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open 'D:\Website\<my file directory>\node_modules\react-router-dom\dist\index.js'
</code>```

So, now what can I do to solve this problem? Thanks in advance...

ContentLicense: CC BY-SA 4.0

Body:
I am using "react-router-dom": "^5.2.0" and I've isntalled it with this code npm install react-router-dom@5.2.0 But now it is showing this error message:

Compiled with problems:

ERROR in ./node_modules/react-router-dom/dist/index.js

Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open 'D:\Website\<my file directory>\node_modules\react-router-dom\dist\index.js'

So, now what can I do to solve this problem? Thanks in advance...


问:
istanbul generates empty report
I wanted to launch istanbul in my project, however no matter what I do reports shows only zeros. like below :

```<code>
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |
----------|---------|----------|---------|---------|-------------------

</code>```

Even though it shows above the coverage report list of the test that passed. For simplicity I created super simple project for replication where I have only one function in indentity.js file :

```<code>export const identity = (x) => x;

</code>```

and one simple test licated in test.js file

```<code>import { identity } from "./identity.js";
import assert from "assert";

describe("identity", function () {
  it("should return passed argument", () => {
    assert.equal(identity(1), 1);
    assert.equal(identity("string"), "string");
    assert.deepEqual(identity({ a: 1 }), { a: 1 });
  });
});

</code>```

and after I run nyc mocha I expect to see 100% coverage but what I have is the same table with zeros.
Is there some settings I missed to see proper coverage report ?
Thx in advance.

Title: istanbul generates empty report

Body:
I wanted to launch istanbul in my project, however no matter what I do reports shows only zeros. like below :

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |
----------|---------|----------|---------|---------|-------------------

Even though it shows above the coverage report list of the test that passed. For simplicity I created super simple project for replication where I have only one function in indentity.js file :

export const identity = (x) => x;

and one simple test licated in test.js file

import { identity } from "./identity.js";
import assert from "assert";

describe("identity", function () {
  it("should return passed argument", () => {
    assert.equal(identity(1), 1);
    assert.equal(identity("string"), "string");
    assert.deepEqual(identity({ a: 1 }), { a: 1 });
  });
});

and after I run nyc mocha I expect to see 100% coverage but what I have is the same table with zeros.
Is there some settings I missed to see proper coverage report ?
Thx in advance.


问:
Could not find an appender named [appender_name_IS_UNDEFINED]
I am using Spring Spring Boot :: (v2.7.7-SNAPSHOT)
I was trying to access configuration from application.yaml file to logback-spring.xml but the problem is it always shows me error that: Could not find an appender named [appender_name_IS_UNDEFINED]. I have attached my code here for better understanding. Please help me i am trying to fix this last 2 days but i am failed. Thank you

application.yaml

```<code>
</code>```
```<code>`server:
  port: 80
app:
  logging-to:console
logging:
  level:
    "[org.springframework]": INFO
    "[com.med4pan.cloudapp]": DEBUG`
</code>```
```<code>
</code>```

logback-spring.xml

```<code>
</code>```
```<code>`<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/looging/logback/defaults.xml"/>
    <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
    <springProperty scope="context" name="CONSOLE_PATTERN" source="application.console-pattern"/>
    <springProperty scope="context" name="appender_name" source="app.logging-to"/>

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>Cloud-Panel-Logs.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>Cloud-Panel-Logs.%d{yyyy-MM}.log</fileNamePattern>
            <maxHistory>6</maxHistory>
            <totalSizeCap>1GB</totalSizeCap>
        </rollingPolicy>
        <encoder>
            <pattern>%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <appender name="ASYNC_CONSOLE" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="${appender_name}"/>
        <discardingThreshold>0</discardingThreshold>
        <queueSize>100000</queueSize>
        <includeCallerData>false</includeCallerData>
        <neverBlock>false</neverBlock>
    </appender>

    <root level="INFO">
        <appender-ref ref="ASYNC_CONSOLE"/>
    </root>
    <logger name="org.springframework.web" level="DEBUG"/>
</configuration>`
</code>```
```<code>
</code>```

Error

```<code>
</code>```

Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [appender_name_IS_UNDEFINED]. Did you define it below instead of above in the configuration file?
ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details.
ERROR in ch.qos.logback.classic.AsyncAppender[ASYNC_CONSOLE] - No attached appenders found.
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:344)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 87 common frames omitted

```<code>
</code>```

I follwed the link which given in error file i think i have configured the file according to the instruction but it didn't work
text

Body:
I am using Spring Spring Boot :: (v2.7.7-SNAPSHOT)
I was trying to access configuration from application.yaml file to logback-spring.xml but the problem is it always shows me error that: Could not find an appender named [appender_name_IS_UNDEFINED]. I have attached my code here for better understanding. Please help me i am trying to fix this last 2 days but i am failed. Thank you

application.yaml

`server:
  port: 80
app:
  logging-to:console
logging:
  level:
    "[org.springframework]": INFO
    "[com.med4pan.cloudapp]": DEBUG`

logback-spring.xml

`<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/looging/logback/defaults.xml"/>
    <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
    <springProperty scope="context" name="CONSOLE_PATTERN" source="application.console-pattern"/>
    <springProperty scope="context" name="appender_name" source="app.logging-to"/>

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>Cloud-Panel-Logs.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>Cloud-Panel-Logs.%d{yyyy-MM}.log</fileNamePattern>
            <maxHistory>6</maxHistory>
            <totalSizeCap>1GB</totalSizeCap>
        </rollingPolicy>
        <encoder>
            <pattern>%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <appender name="ASYNC_CONSOLE" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="${appender_name}"/>
        <discardingThreshold>0</discardingThreshold>
        <queueSize>100000</queueSize>
        <includeCallerData>false</includeCallerData>
        <neverBlock>false</neverBlock>
    </appender>

    <root level="INFO">
        <appender-ref ref="ASYNC_CONSOLE"/>
    </root>
    <logger name="org.springframework.web" level="DEBUG"/>
</configuration>`

Error

Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [appender_name_IS_UNDEFINED]. Did you define it below instead of above in the configuration file?
ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details.
ERROR in ch.qos.logback.classic.AsyncAppender[ASYNC_CONSOLE] - No attached appenders found.
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:344)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 87 common frames omitted

I follwed the link which given in error file i think i have configured the file according to the instruction but it didn't work
text


问:
Pandas dataframe combine two or more rows and add values of specific columns in these rows
I have a pandas data frame and i need to combine two or more rows and add values of specific column for these rows.

Below is an example of the dataframe exported to csv

```<code>symbol,orderId,price,qty,time,isBuyer
TRXUSDT,60180710.0,0.03028,429.4,2019-05-15 05:10:03,SELL
TRXUSDT,60180710.0,0.03025,10000.0,2019-05-15 05:10:03,SELL
TRXUSDT,60180710.0,0.03024,3856.2,2019-05-15 05:10:03,SELL
TRXUSDT,60180710.0,0.03026,14630.6,2019-05-15 05:10:03,SELL
</code>```

Above rows have the same symbol, orderId, time and isBuyer columns.
But they have different "qty", and "price".

I would like to combine it into one row and sum the "qty" values into one single value, and the average of "price" values into single value

What is the best way to do it?

Body:
I have a pandas data frame and i need to combine two or more rows and add values of specific column for these rows.

Below is an example of the dataframe exported to csv

symbol,orderId,price,qty,time,isBuyer
TRXUSDT,60180710.0,0.03028,429.4,2019-05-15 05:10:03,SELL
TRXUSDT,60180710.0,0.03025,10000.0,2019-05-15 05:10:03,SELL
TRXUSDT,60180710.0,0.03024,3856.2,2019-05-15 05:10:03,SELL
TRXUSDT,60180710.0,0.03026,14630.6,2019-05-15 05:10:03,SELL

Above rows have the same symbol, orderId, time and isBuyer columns.
But they have different "qty", and "price".

I would like to combine it into one row and sum the "qty" values into one single value, and the average of "price" values into single value

What is the best way to do it?


问:
Build versioning for django
I would like to build versioning for my django models. I have already tried django-reversion but i think that is not good for my use case and i have problems with many-to-many through models and multi table inheritance.

My use case:
I have a multi tenant web app. Every tenant have their own pool of resources. The tenants can create documents and reference to the resources.
Here is a simple diagram:

Now on every update from the document or a resource that is referenced in the document i would create a version of the document.
So the version should show all changes of the document and the referenced resources.
But on revert to a version only the direct values of the document should reverted and not the resources.
For example a document:

Now i edit the document and delete the resource_1 with the id 1. Also i change the name from the resource_1 with the id 2.

When i revert this document to the first version, it should look like this:

But how can i achieve this?
I think i can use MongoDB to store complete version of a document as serialized json data on every update. And  can create a signal for the resources if it changed and check the correspondent documents to create also a version for the document.
Then i create for each tenant a new collection in MongoDB.

The resources itself should also have a versioning and also other models in my webapp but for the example that is not important.

Title: Build versioning for django


问:
How can I fix column spanning issue in css flex box
check image for better understanding
I want box three(blue) to come right below box one(red) currently white space inbetween them.
Here, the content height of the box two(gree) is greater than box one hence stretching that extra space.  I need to cover up that empty white space .

I can not use GRID here, as I already used react-bootstrap Row/Col on my entier react site.

https://codesandbox.io/s/suspicious-david-i2vnht?file=/src/index.js:23-322

I used flexbox and tried using

```<code>aligh-items:flex-start/flex-end
</code>```

does not work.

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
}
#app {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.one,
.two,
.three,
.four {
  flex-grow: 1;
}
/* .one,.two,.three,.four, .five,.six{
  flex-grow:1;
  width:33%;
} */
.one {
  background: red;
  padding: 50px;
  order: 0;
  width: 67%;
}
.two {
  background: green;
  order: 1;
  padding: 1rem;
  width: 33%;
  height: 30vh;
}
.three {
  background: blue;
  order: 2;
  width: 67%;
  height: 50vh;
}
.four {
  background: tomato;
  order: 3;
  width: 33%;
}
.five {
  background: goldenrod;
  order: 1;
}
.six {
  background: orange;
  order: 0;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="app">
  <div class="one">ONE</div>
  <div class="three">THREE</div>
  <div class="two">Two</div>
  <div class="four">FOUR</div>
  <!-- <div class="five">Five</div> -->
  <!-- <div class="six">Six</div> -->
</div></code>```

Body:
check image for better understanding
I want box three(blue) to come right below box one(red) currently white space inbetween them.
Here, the content height of the box two(gree) is greater than box one hence stretching that extra space.  I need to cover up that empty white space .

I can not use GRID here, as I already used react-bootstrap Row/Col on my entier react site.

https://codesandbox.io/s/suspicious-david-i2vnht?file=/src/index.js:23-322

I used flexbox and tried using

aligh-items:flex-start/flex-end

does not work.

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
}
#app {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.one,
.two,
.three,
.four {
  flex-grow: 1;
}
/* .one,.two,.three,.four, .five,.six{
  flex-grow:1;
  width:33%;
} */
.one {
  background: red;
  padding: 50px;
  order: 0;
  width: 67%;
}
.two {
  background: green;
  order: 1;
  padding: 1rem;
  width: 33%;
  height: 30vh;
}
.three {
  background: blue;
  order: 2;
  width: 67%;
  height: 50vh;
}
.four {
  background: tomato;
  order: 3;
  width: 33%;
}
.five {
  background: goldenrod;
  order: 1;
}
.six {
  background: orange;
  order: 0;
}

ONE

THREE

Two

FOUR


问:
"make: the '-j' option requires a positive integer argument"
When I am trying to compile a set of *.c files, I am getting following error.
make: the '-j' option requires a positive integer argument

I am using make -j8 as command for compiling. If anyone knows, please help.

The compilation should be successful.


问:
How to use yml file from an application into different application in spring boot
Anybody can tell me how to use yml file from an application into different application in model in spring boot.

I have tried @PropertySource but its not working.


问:
Making a music player in QT
I'm still very new to QT and coding. I want to make a simple music player application. I designed an interface in general but I have no idea what to do to get the music playing. Can you give me information about this ?

How to run audio files in music player build with QT?

Title: Making a music player in QT


问:
Angular docker page note found
I am trying to run a specific version of an angular project on a specific version of node in a docker container.

I build an docker image and run it on a container on a specific port. It tell me than the compile is successfull and then i just have to go on the localhost:[myport] but i get a "Page not found" error.

Here is my docker file :

```<code>FROM node:10.24 AS ui-build

WORKDIR /usr/src/app

COPY . /usr/src/app/
ADD run.sh ./run.sh

RUN npm install @angular/cli@7.3.9 && npm install
RUN chmod 777 ./run.sh

EXPOSE 9004

# using the script 'run.sh' to run the app
# this script run the app depending on his name
CMD ./run.sh particulier
</code>```

enter image description here

enter image description here

As you can see in those image my container is running well, it compiles my node module inside the container and tell me to go on localhost:9004 to see my app

But I get an Page not found error.
enter image description here

Here my docker run command : docker run -it -p  9004:4200 --name hiero_particulierv6.2 angular-node-image-v6

EDIT
I changed the dockerfile by getting out the EXPOSE 9004 code.

Because, as you can see in the CMD part, I call a script run.sh, and this script run the app on different port depending on the name :

```<code>#!/bin/bash

# Exit on error
set -o errexit

curdir=$(pwd)

app=""
port=0
extra=""

if [ "$1" = "hiero" ]; then
  app="hiero"
  port="9000"
  # extra="--proxy-config ./dev_config/app.proxy.conf.js"
elif [ "$1" = "admin" ]; then
  app="admin"
  port="9001"
elif [ "$1" = "pdf" ]; then
  app="pdf"
  port="9002"
  elif [ "$1" = "pro" ]; then
  app="pro"
  port="9003"
  elif [ "$1" = "particulier" ]; then
  app="particulier"
  port="9004"
else
  echo "Unknown app: $1"
  echo "Try: ./run.sh hiero"
fi

if [ ! -z "$app" ]; then
  ./node_modules/@angular/cli/bin/ng serve --aot --project $app --port $port $extra
fi
</code>```

Title: Angular docker page note found

Body:
I am trying to run a specific version of an angular project on a specific version of node in a docker container.

I build an docker image and run it on a container on a specific port. It tell me than the compile is successfull and then i just have to go on the localhost:[myport] but i get a "Page not found" error.

Here is my docker file :

FROM node:10.24 AS ui-build

WORKDIR /usr/src/app

COPY . /usr/src/app/
ADD run.sh ./run.sh

RUN npm install @angular/cli@7.3.9 && npm install
RUN chmod 777 ./run.sh

EXPOSE 9004

# using the script 'run.sh' to run the app
# this script run the app depending on his name
CMD ./run.sh particulier

enter image description here

enter image description here

As you can see in those image my container is running well, it compiles my node module inside the container and tell me to go on localhost:9004 to see my app

But I get an Page not found error.
enter image description here

Here my docker run command : docker run -it -p  9004:4200 --name hiero_particulierv6.2 angular-node-image-v6

EDIT
I changed the dockerfile by getting out the EXPOSE 9004 code.

Because, as you can see in the CMD part, I call a script run.sh, and this script run the app on different port depending on the name :

#!/bin/bash

# Exit on error
set -o errexit

curdir=$(pwd)

app=""
port=0
extra=""

if [ "$1" = "hiero" ]; then
  app="hiero"
  port="9000"
  # extra="--proxy-config ./dev_config/app.proxy.conf.js"
elif [ "$1" = "admin" ]; then
  app="admin"
  port="9001"
elif [ "$1" = "pdf" ]; then
  app="pdf"
  port="9002"
  elif [ "$1" = "pro" ]; then
  app="pro"
  port="9003"
  elif [ "$1" = "particulier" ]; then
  app="particulier"
  port="9004"
else
  echo "Unknown app: $1"
  echo "Try: ./run.sh hiero"
fi

if [ ! -z "$app" ]; then
  ./node_modules/@angular/cli/bin/ng serve --aot --project $app --port $port $extra
fi


问:
MongoServerError: no such command: "setFreeMonitoring"
When I run

```<code>db.enableFreeMonitoring()
</code>```

I get following error:

```<code>MongoServerError: no such command: 'setFreeMonitoring'
    at Connection.onMessage (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:594013)
    at MessageStream.<anonymous> (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:591788)
    at MessageStream.emit (node:events:394:28)
    at c (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:1917:292193)
    at MessageStream._write (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:1917:290794)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at MessageStream.Writable.write (node:internal/streams/writable:334:10)
    at TLSSocket.ondata (node:internal/streams/readable:749:22)
    at TLSSocket.emit (node:events:394:28)
</code>```

db.getFreeMonitoringStatus() works fine.
My MongoDB Compass Version is 1.34.1, MongoDB version 5.0.14.

I tried to change roles and disable Free Monitoring first (db.disableFreeMonitoring() - with the same error).

Body:
When I run

db.enableFreeMonitoring()

I get following error:

MongoServerError: no such command: 'setFreeMonitoring'
    at Connection.onMessage (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:594013)
    at MessageStream.<anonymous> (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:2:591788)
    at MessageStream.emit (node:events:394:28)
    at c (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:1917:292193)
    at MessageStream._write (/Applications/MongoDB Compass.app/Contents/Resources/app.asar.unpacked/node_modules/@mongosh/node-runtime-worker-thread/dist/worker-runtime.js:1917:290794)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at MessageStream.Writable.write (node:internal/streams/writable:334:10)
    at TLSSocket.ondata (node:internal/streams/readable:749:22)
    at TLSSocket.emit (node:events:394:28)

db.getFreeMonitoringStatus() works fine.
My MongoDB Compass Version is 1.34.1, MongoDB version 5.0.14.

I tried to change roles and disable Free Monitoring first (db.disableFreeMonitoring() - with the same error).


问:
Retreiving JS cookies work on apache localhost but not on the server
I'm adding light mode to my website but I'm facing the problem when I try to retrieve that cookie to display either dark or light mode. Everything works perfectly and as intended with apache localhost but whenever I upload it to the actual server that's when things go wrong, it does save the dark/light mode cookie in the browser but doesn't actually display the mode which is suppose to be displayed. For a better demonstration, here's how I set a cookie and retrieve it:

```<code>$('.change_mode').click(function () {

    if ($('body').hasClass('light-mode')) {
        $('body').removeClass('light-mode');

        document.cookie = "lightMode=false";

        $('.change_mode img').attr('src', 'img/sun.png');
        $('body').css('background', 'url("img/landing_bg_dark.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_dark.png');
        $('.left_side img').attr('src', 'img/logo_dark.png');
        $('.menu_close img').attr('src', 'img/x_dark.png');

        $('.img_name img').attr('src', 'img/user-contact.png');
        $('.img_email img').attr('src', 'img/email-contact.png');
        $('.img_phone img').attr('src', 'img/phone-contact.png');
    } else {
        $('body').addClass('light-mode');

        document.cookie = "lightMode=true";

        $('.change_mode img').attr('src', 'img/moon.png');
        $('body').css('background', 'url("img/landing_bg_light.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_light.png');
        $('.left_side img').attr('src', 'img/logo_light.png');
        $('.menu_close img').attr('src', 'img/x_light.png');

        $('.img_name img').attr('src', 'img/user-contact-light.png');
        $('.img_email img').attr('src', 'img/email-contact-light.png');
        $('.img_phone img').attr('src', 'img/phone-contact-light.png');
    }

});

$(document).ready(function () {
    if (document.cookie == 'lightMode=true') {
        $('body').addClass('light-mode');

        $('.change_mode img').attr('src', 'img/moon.png');
        $('body').css('background', 'url("img/landing_bg_light.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_light.png');
        $('.left_side img').attr('src', 'img/logo_light.png');
        $('.menu_close img').attr('src', 'img/x_light.png');

        $('.img_name img').attr('src', 'img/user-contact-light.png');
        $('.img_email img').attr('src', 'img/email-contact-light.png');
        $('.img_phone img').attr('src', 'img/phone-contact-light.png');
    } else {
        $('body').removeClass('light-mode');

        $('.change_mode img').attr('src', 'img/sun.png');
        $('body').css('background', 'url("img/landing_bg_dark.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_dark.png');
        $('.left_side img').attr('src', 'img/logo_dark.png');
        $('.menu_close img').attr('src', 'img/x_dark.png');

        $('.img_name img').attr('src', 'img/user-contact.png');
        $('.img_email img').attr('src', 'img/email-contact.png');
        $('.img_phone img').attr('src', 'img/phone-contact.png');
    }
});
</code>```

I honestly don't understand what is the problem here, I have this script in a separate JS file and have it linked at the end of the page as it should be. I can still change the mode on the server but when I refresh the page it won't load the cookie and automatically goes to the dark mode even I have the light mode activated. Same happens to the preloader I'm using, it works at first, disappears after the page fully loads but the moment I refresh the same page, it won't go away, like the script just gets stuck for some reason. I also have the preloader in the same file as a cookie script, at the top of it, this file is called main.js (where I keep all of the scripts I need for every page). Here's the preloader script

```<code>$(document).ready(function () {
    window.onload = function () {
        $('.loader-container').delay(300).fadeOut('slow');
        $('body').css('overflow', 'auto');
    };
});
</code>```

I honestly have no clue what to do because everything seems to be right for me, please suggest if you have any ideas. Thanks in advance.

Everything looks normal to me but still it's not working, can't find much about this online.

EDIT
There are no errors in the console whatsoever.

Body:
I'm adding light mode to my website but I'm facing the problem when I try to retrieve that cookie to display either dark or light mode. Everything works perfectly and as intended with apache localhost but whenever I upload it to the actual server that's when things go wrong, it does save the dark/light mode cookie in the browser but doesn't actually display the mode which is suppose to be displayed. For a better demonstration, here's how I set a cookie and retrieve it:

$('.change_mode').click(function () {

    if ($('body').hasClass('light-mode')) {
        $('body').removeClass('light-mode');

        document.cookie = "lightMode=false";

        $('.change_mode img').attr('src', 'img/sun.png');
        $('body').css('background', 'url("img/landing_bg_dark.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_dark.png');
        $('.left_side img').attr('src', 'img/logo_dark.png');
        $('.menu_close img').attr('src', 'img/x_dark.png');

        $('.img_name img').attr('src', 'img/user-contact.png');
        $('.img_email img').attr('src', 'img/email-contact.png');
        $('.img_phone img').attr('src', 'img/phone-contact.png');
    } else {
        $('body').addClass('light-mode');

        document.cookie = "lightMode=true";

        $('.change_mode img').attr('src', 'img/moon.png');
        $('body').css('background', 'url("img/landing_bg_light.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_light.png');
        $('.left_side img').attr('src', 'img/logo_light.png');
        $('.menu_close img').attr('src', 'img/x_light.png');

        $('.img_name img').attr('src', 'img/user-contact-light.png');
        $('.img_email img').attr('src', 'img/email-contact-light.png');
        $('.img_phone img').attr('src', 'img/phone-contact-light.png');
    }

});

$(document).ready(function () {
    if (document.cookie == 'lightMode=true') {
        $('body').addClass('light-mode');

        $('.change_mode img').attr('src', 'img/moon.png');
        $('body').css('background', 'url("img/landing_bg_light.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_light.png');
        $('.left_side img').attr('src', 'img/logo_light.png');
        $('.menu_close img').attr('src', 'img/x_light.png');

        $('.img_name img').attr('src', 'img/user-contact-light.png');
        $('.img_email img').attr('src', 'img/email-contact-light.png');
        $('.img_phone img').attr('src', 'img/phone-contact-light.png');
    } else {
        $('body').removeClass('light-mode');

        $('.change_mode img').attr('src', 'img/sun.png');
        $('body').css('background', 'url("img/landing_bg_dark.png") no-repeat center center');
        $('body').css('background-size', 'cover');
        $('.menu_open img').attr('src', 'img/menu_dark.png');
        $('.left_side img').attr('src', 'img/logo_dark.png');
        $('.menu_close img').attr('src', 'img/x_dark.png');

        $('.img_name img').attr('src', 'img/user-contact.png');
        $('.img_email img').attr('src', 'img/email-contact.png');
        $('.img_phone img').attr('src', 'img/phone-contact.png');
    }
});

I honestly don't understand what is the problem here, I have this script in a separate JS file and have it linked at the end of the page as it should be. I can still change the mode on the server but when I refresh the page it won't load the cookie and automatically goes to the dark mode even I have the light mode activated. Same happens to the preloader I'm using, it works at first, disappears after the page fully loads but the moment I refresh the same page, it won't go away, like the script just gets stuck for some reason. I also have the preloader in the same file as a cookie script, at the top of it, this file is called main.js (where I keep all of the scripts I need for every page). Here's the preloader script

$(document).ready(function () {
    window.onload = function () {
        $('.loader-container').delay(300).fadeOut('slow');
        $('body').css('overflow', 'auto');
    };
});

I honestly have no clue what to do because everything seems to be right for me, please suggest if you have any ideas. Thanks in advance.

Everything looks normal to me but still it's not working, can't find much about this online.

EDIT
There are no errors in the console whatsoever.


问:
How to memoize nested function in react js
How to memoize nested function?
For e.g., if we have following memoized components App, Test, OtherComponent

```<code>const App = React.memo(() => {
  const handleChange = useCallback((rowData) => (option) => {},[]);
  return <Test data={data} handleChange={handleChange} />;
});

const Test = React.memo(({ data, handleChange }) =>{
  return (
    <div>
      {data.map((rowData) => (
        <OtherComp handleChange={handleChange(rowData)} />
      ))}
    </div>
  );
});

const OtherComp = React.memo(({ handleChange }) =>{});
</code>```

React.memo will work only if we pass it memoized functions/objects.
If we use useCallback, it won’t memoize inner function and React.memo  won’t work for OtherComponent.

Body:
How to memoize nested function?
For e.g., if we have following memoized components App, Test, OtherComponent

const App = React.memo(() => {
  const handleChange = useCallback((rowData) => (option) => {},[]);
  return <Test data={data} handleChange={handleChange} />;
});

const Test = React.memo(({ data, handleChange }) =>{
  return (

      {data.map((rowData) => (
        <OtherComp handleChange={handleChange(rowData)} />
      ))}

  );
});

const OtherComp = React.memo(({ handleChange }) =>{});

React.memo will work only if we pass it memoized functions/objects.
If we use useCallback, it won’t memoize inner function and React.memo  won’t work for OtherComponent.


问:
inputting time in seconds and coverting it into seconds,minutes,hours and then the clock should start from that time onwards
it's the  code i have scripted but the output i needed is

User will enter seconds in input tag (value should be in between 0 to 86400).

On submit seconds time should be converted in HH:ii:SS time format

It should also show whether time is AM/PM.

without using image/video to represent digital number only using html tag,js and css only.

Time should continue to iterate per second once submitted.(e.g 10:00:01 to 10:00:02 to 10:00:03
and so on).

Default value should be 00:00:00 AM

function Convert() {
  var sec = parseInt(document.getElementById("input").value);
  var seconds = sec % 60;
  var minutes = ((sec - seconds) / 60) % 60;
  var hours = Math.trunc(((sec - seconds) / 60) / 60);
  if (hours > 12) {
    document.getElementById("hr").innerHTML = `${hours-12}:`;
    document.getElementById("mn").innerHTML = `${minutes}:`;
    document.getElementById("ss").innerHTML = `${seconds}`;
    document.getElementById("ap").innerHTML = `PM`;
  } else {
    document.getElementById("hr").innerHTML = `${hours}:`;
    document.getElementById("mn").innerHTML = `${minutes}:`;
    document.getElementById("ss").innerHTML = `${seconds}`;
    document.getElementById("ap").innerHTML = `AM`;
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="clock">
  <div id="hr">00:</div>
  <div id="mn">00:</div>
  <div id="ss">00</div>
  <div class="ampm">
    <div id="ap">AM</div>
  </div>
</div>

<div class="Input">
  <input type="number" min="0" max="" id="input" placeholder="Enter time in seconds">
</div>

<div id="Container">
  <button type="button" onclick="Convert()">Submit</button>
</div></code>```

Body:
it's the  code i have scripted but the output i needed is

User will enter seconds in input tag (value should be in between 0 to 86400).

On submit seconds time should be converted in HH:ii:SS time format

It should also show whether time is AM/PM.

without using image/video to represent digital number only using html tag,js and css only.

Time should continue to iterate per second once submitted.(e.g 10:00:01 to 10:00:02 to 10:00:03
and so on).

Default value should be 00:00:00 AM

function Convert() {
  var sec = parseInt(document.getElementById("input").value);
  var seconds = sec % 60;
  var minutes = ((sec - seconds) / 60) % 60;
  var hours = Math.trunc(((sec - seconds) / 60) / 60);
  if (hours > 12) {
    document.getElementById("hr").innerHTML = `${hours-12}:`;
    document.getElementById("mn").innerHTML = `${minutes}:`;
    document.getElementById("ss").innerHTML = `${seconds}`;
    document.getElementById("ap").innerHTML = `PM`;
  } else {
    document.getElementById("hr").innerHTML = `${hours}:`;
    document.getElementById("mn").innerHTML = `${minutes}:`;
    document.getElementById("ss").innerHTML = `${seconds}`;
    document.getElementById("ap").innerHTML = `AM`;
  }
}

00:

00:

00

AM

  <input type="number" min="0" max="" id="input" placeholder="Enter time in seconds">

  <button type="button" onclick="Convert()">Submit</button>


问:
Trigger Jenkins job by tag with Gitea
I work with Gitea and jenkins and I try to trigger a Jenkins job at the tag change in Gitea.

I installed the Gitea plugin and I have a multibranch pipeline with my repo in it.

I added the following line to my Pipeline:

```<code>refspec: '+refs/tags/*:refs/remotes/origin/tags/*'
</code>```

I also checked this box in my Jenkins job:
Poll SCM

Unfortunately my job won't start, could you help me?

Thanks for everything

Title: Trigger Jenkins job by tag with Gitea

Body:
I work with Gitea and jenkins and I try to trigger a Jenkins job at the tag change in Gitea.

I installed the Gitea plugin and I have a multibranch pipeline with my repo in it.

I added the following line to my Pipeline:

refspec: '+refs/tags/*:refs/remotes/origin/tags/*'

I also checked this box in my Jenkins job:
Poll SCM

Unfortunately my job won't start, could you help me?

Thanks for everything


问:
Angular 15: Migrating require.context to import.meta.webpackContext is causing this error: {}.webpackContext is not a function
I've recently upgraded Angular 14 to 15 and with it there was issues with require.context.

Without getting into that - I've used import.meta.webpackContext which is meant to be the ESM equivalent to the former where it returns the same requireContext object.

However after using the new function I'm getting this error:
{}.webpackContext is not a function

```<code>function importAll(r: __WebpackModuleApi.RequireContext) {
  r.keys().forEach((key: string) => (cache[key] = r(key)));
}

const ESM_CONFIG = {
  recursive: true,
  regExp: /\.[j|t]s$/,
  exclude: /spec\.[j|t]s$/,
};

if (import.meta.webpackContext) {
  importAll(import.meta.webpackContext('./services/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./components/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./directives/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./filters/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./native-extensions/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./prototypes/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./views/', ESM_CONFIG));
}
</code>```

Body:
I've recently upgraded Angular 14 to 15 and with it there was issues with require.context.

Without getting into that - I've used import.meta.webpackContext which is meant to be the ESM equivalent to the former where it returns the same requireContext object.

However after using the new function I'm getting this error:
{}.webpackContext is not a function

function importAll(r: __WebpackModuleApi.RequireContext) {
  r.keys().forEach((key: string) => (cache[key] = r(key)));
}

const ESM_CONFIG = {
  recursive: true,
  regExp: /\.[j|t]s$/,
  exclude: /spec\.[j|t]s$/,
};

if (import.meta.webpackContext) {
  importAll(import.meta.webpackContext('./services/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./components/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./directives/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./filters/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./native-extensions/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./prototypes/', ESM_CONFIG));
  importAll(import.meta.webpackContext('./views/', ESM_CONFIG));
}


问:
Unexpected end of stream React Native with Laravel
I'm using Expo FileSystem API to download files from URLs.

This is a sample code:

const downloadMedia = async (filename: string) => {
        const downloadResumable = FileSystem.createDownloadResumable(
            `http://192.168.1.99/api/media/${filename}/download`,
            await makeDownloadPath(filename),
            {
                headers: {
                    Authorization: "Bearer xxx",
                },
            },
            progress => {
                console.log(`Downloading... Progress`, progress);
            }
        );

        const download = await downloadResumable.downloadAsync();

        console.log("Download finished", download);
    };
```
<p>It works perfectly with any of the URLs provided here: Example Videos, no matter the size. However, when I try to download files from my local Laravel backend using Laravel Sail (docker), that has a route like this:</p>
<pre class="lang-php prettyprint-override"><code>return Storage::download($media->path);
</code>```

React native keeps throwing "Unexpected end of stream" error.

If I keep trying to download several times, sometimes it can finish the download. If the file is very small: 500kb <, it almost always works fines.

Here I have an example with a file larger then 2MB:

I had to press the download button more than 5 times so the download could finish properly.

The issue doesn't occur in the browser, Postman and Node with axios. I tried changing Laravel disk storage and a different Android emulator, the issue still remained in React Native.

Body:
I'm using Expo FileSystem API to download files from URLs.

This is a sample code:

const downloadMedia = async (filename: string) => {
        const downloadResumable = FileSystem.createDownloadResumable(
            `http://192.168.1.99/api/media/${filename}/download`,
            await makeDownloadPath(filename),
            {
                headers: {
                    Authorization: "Bearer xxx",
                },
            },
            progress => {
                console.log(`Downloading... Progress`, progress);
            }
        );

        const download = await downloadResumable.downloadAsync();

        console.log("Download finished", download);
    };

It works perfectly with any of the URLs provided here: Example Videos, no matter the size. However, when I try to download files from my local Laravel backend using Laravel Sail (docker), that has a route like this:

return Storage::download($media->path);

React native keeps throwing "Unexpected end of stream" error.

If I keep trying to download several times, sometimes it can finish the download. If the file is very small: 500kb <, it almost always works fines.

Here I have an example with a file larger then 2MB:

I had to press the download button more than 5 times so the download could finish properly.

The issue doesn't occur in the browser, Postman and Node with axios. I tried changing Laravel disk storage and a different Android emulator, the issue still remained in React Native.


问:
The different behaviour in Local and AWS postgres
The to_tsquery() function of postgresql behaves diffrently in local and AWS instances,
ex : SELECT column FROM table WHERE column @@ to_tsquery('sometext');

do we need any additional set up to run to_tsquery() in AWS.


问:
cache issue after migrating from one platform to another
recently I moved from cs-cart 4.8 to Magento 2.4.3 and many website users are getting [ This page isn’t working the problem continues, contact the site owner.
HTTP ERROR 400 ]

when I open the website from a private tab it opens normally, I get that I need to clear the browser cache but the vendors and customers they don't know that, how can I fix this issue?

i tried to do css versioning, but the same.


问:
passing array of Objects to controller fails
I am trying to pass an array of objects to controller by ajax. so I did this

```<code> var postData = {};
for (let i=0; i<@Model.Count; i++)
{
    var packageId="#z"+i+"__PackageId";
    var cartItemId="#z"+i+"__CartItemId";
     var childId="#childId_"+i;
      var arobject={
             'PackageId' : $(packageId).val(),
             'CartItemId' : $(cartItemId).val(),
             'ChildId' : $(childId).val(),
              };
        postData.push(arobject);
  }

  $.ajax({
     type: 'POST',
     contentType: "application/json",
      url: '/cart/CheckEligible',
      data: JSON.stringify(postData),
      success: function (data) {}
       //something
      });
</code>```

and I want to have it in controller

```<code> public async Task<JsonResult> CheckEligible(CartDropDownV2[] cartItemDto)
    {
       //something
        return Json(null);
    }
</code>```

but I can not have any value in cartItemDto

Body:
I am trying to pass an array of objects to controller by ajax. so I did this

 var postData = {};
for (let i=0; i<@Model.Count; i++)
{
    var packageId="#z"+i+"__PackageId";
    var cartItemId="#z"+i+"__CartItemId";
     var childId="#childId_"+i;
      var arobject={
             'PackageId' : $(packageId).val(),
             'CartItemId' : $(cartItemId).val(),
             'ChildId' : $(childId).val(),
              };
        postData.push(arobject);
  }

  $.ajax({
     type: 'POST',
     contentType: "application/json",
      url: '/cart/CheckEligible',
      data: JSON.stringify(postData),
      success: function (data) {}
       //something
      });

and I want to have it in controller

 public async Task<JsonResult> CheckEligible(CartDropDownV2[] cartItemDto)
    {
       //something
        return Json(null);
    }

but I can not have any value in cartItemDto


问:
Reboot a Linux slave in a jenkins pipeline script
I have a jenkins pipeline script. I want to reboot the linux slave and wait for 5min till the slave is up and run my script. when I do sudo reboot, the current build is failing with exception is there any way to do this?

tried below apporach, my expectation is pipeline should not fail/get intruupted due to this reboot
sh """
sudo su <<HERE
sudo reboot
HERE
"""
retry(48){
sleep 5
sh "ssh -o ConnectTimeout=1 hostname exit"
}


问:
The openFDA API supports searching by range in date not working?
I would like to create an url, that shows me all reports from the MAUDE database from December with the product key 'MQB'.

The problem is, that all reports from all months are displayed to me. The date limit doesn't really apply.

I created the following URL for it:

https://api.fda.gov/device/recall.json?search=product_code:MQB+event_date_posted:[2022-12-01+TO+2022-12-31]&limit=1000.

I also tried without the hyphens between the year, month and day, so: '...[20221201+TO+20221231]&limit=1000'.

Has anyone had the same or a similar problem?

The syntax of the query is described on the official site, here: https://open.fda.gov/apis/dates-and-ranges/