问:
Getting Error: RabbitMQ.Client.Exceptions.BrokerUnreachableException
I am new to rabbitMQ. I enabled TLS for rabbitMQ on my local. As a part of it I created the certificate on my WINDOWS machine (followed the LINIUX Step) as discussed in the https://www.rabbitmq.com/ssl.html.

Also updated the rabbitMQ.config file as below:

```<code>[
  {rabbit, [
     {ssl_listeners, [5671]},
     {ssl_options, [
                    {cacertfile,"/etc/ca_certificate.pem"},
                    {certfile,"/etc/private_key.pem"},
                    {keyfile,"/etc/server_certificate.pem"},
                    {password,  "MySecretPassword"},
                    {verify,verify_peer},
                    {fail_if_no_peer_cert,true}
            ]}
   ]}
].
</code>```

Steps followed to create the certificates on WINDOWS MACHINE:

Bash Cmd Prompt:

cd /C/temp/ThirdOne
mkdir testca
cd testca
mkdir certs private
chmod 700 private
echo 01 > serial
touch index.txt

Using OpenSSL CMD

openssl req -x509 -config openssl.cnf -newkey rsa:2048 -days 365 -out ca_certificate.pem -outform PEM -subj /CN=MyTestCA/ -nodes

openssl x509 -in ca_certificate.pem -out ca_certificate.cer -outform DER

mkdir server

cd server

openssl genrsa -out private_key.pem 2048

openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=desktop-s08pnk3/O=server/ -nodes

cd..

openssl ca -config openssl.cnf -in ./server/req.pem -out ./server/server_certificate.pem -notext -batch -extensions server_ca_extensions

openssl pkcs12 -export -out ./server/server_certificate.p12 -in ./server/server_certificate.pem -inkey ./server/private_key.pem -passout pass:MySecretPassword

mkdir client

cd client

openssl genrsa -out private_key.pem 2048

openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=desktop-s08pnk3/O=client/ -nodes

cd..

openssl ca -config openssl.cnf -in ./client/req.pem -out ./client/client_certificate.pem -notext -batch -extensions client_ca_extensions

openssl pkcs12 -export -out ./client/client_certificate.p12 -in ./client/client_certificate.pem -inkey ./client/private_key.pem -passout pass:MySecretPassword

On top of it I installed the certificate of client on Local.

NOTE: My client and server are both are local machine only.

Code that I am using for connecting to rabbit MQ:

```<code> private static void RabbitMQWithSSLEnable()
        {
            try
            {
                string rabbitmqHostName = "desktop-s08pnk3";
                string rabbitmqServerName = "desktop-s08pnk3";
                string certificateFilePath = @"C:\temp\ThirdOne\client\client_certificate.pem";
                string certificatePassphrase = "MySecretPassword";
                string rabbitmqUsername = "test";
                string rabbitmqPassword = "test";

                var factory = new ConnectionFactory();

                factory.HostName = rabbitmqHostName;
                factory.UserName = rabbitmqUsername;
                factory.Password = rabbitmqPassword;

                //factory.Uri = new Uri("amqps://test:test@desktop-s08pnk3");

                factory.AuthMechanisms = new IAuthMechanismFactory[] { new ExternalMechanismFactory() };

                // Note: This should NEVER be "localhost"
                factory.Ssl.ServerName = rabbitmqServerName;

                // Path to my .p12 file.
                factory.Ssl.CertPath = certificateFilePath;
                // Passphrase for the certificate file - set through OpenSSL
                factory.Ssl.CertPassphrase = certificatePassphrase;

                factory.Ssl.Enabled = true;
                // Make sure TLS 1.2 is supported & enabled by your operating system
                factory.Ssl.Version = SslProtocols.Tls12;

                // This is the default RabbitMQ secure port
                factory.Port = AmqpTcpEndpoint.UseDefaultPort;
                factory.VirtualHost = "/";
                factory.Ssl.AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateChainErrors | SslPolicyErrors.RemoteCertificateNameMismatch | SslPolicyErrors.RemoteCertificateNotAvailable;

                //System.Net.ServicePointManager.Expect100Continue = false;

                using (var connection = factory.CreateConnection())
                {
                    using (var channel = connection.CreateModel())
                    {
                        // publish some messages...
                    }
                }
            }
            catch (System.Exception ex)
            {
                var error = ex.ToString();
                System.Console.WriteLine(error);
            }
        }
</code>```

The above code is throwing error:

```<code>RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable
 ---> System.AggregateException: One or more errors occurred. (Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..)
 ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
 ---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
   --- End of inner exception stack trace ---
   at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ProcessAuthentication(LazyAsyncResult lazyResult, CancellationToken cancellationToken)
   at System.Net.Security.SslStream.BeginAuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.Security.SslStream.BeginAuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__64_1(String arg1, X509CertificateCollection arg2, SslProtocols arg3, AsyncCallback callback, Object state)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2,TArg3](Func`6 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2,TArg3](Func`6 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state)
   at System.Net.Security.SslStream.AuthenticateAsClientAsync(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at RabbitMQ.Client.Impl.SslHelper.<>c__DisplayClass2_0.<TcpUpgrade>b__0(SslOption opts)
   at RabbitMQ.Client.Impl.SslHelper.TcpUpgrade(Stream tcpStream, SslOption options)
   at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, Func`2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout)
   at RabbitMQ.Client.Framing.Impl.IProtocolExtensions.CreateFrameHandler(IProtocol protocol, AmqpTcpEndpoint endpoint, ArrayPool`1 pool, Func`2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout)
   at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler(AmqpTcpEndpoint endpoint)
   at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
   --- End of inner exception stack trace ---
   at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
   --- End of inner exception stack trace ---
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection()
   at RabbitMQ.Explore.Program.RabbitMQWithSSLEnable() in C:\Users\warke\source\repos\RabbitMQ.Explore\RabbitMQ.Explore\Program.cs:line 71
</code>```

Can anyone please help me to get it resolved?

Thanks.

Below are the things that I tried:

A) Enabled the TLS on internet options.
B) Enabled Ports also.

@Team FYI and Questions:

I installed the client certificate on my local - Not sure on it
as it's not mentioned.

Do I need to installed the Server
Certificate on my local as I am trying to connect to it from local (client and server both are same machine)

I need to do Peer verification, so created both client and server certificate.

The password added in config and while calling the rabbitMQ on from local is the same which I used to create the certificate for Client and Server.

I created a new user for connection i.e. test and given the admin access to it.

Body:
I am new to rabbitMQ. I enabled TLS for rabbitMQ on my local. As a part of it I created the certificate on my WINDOWS machine (followed the LINIUX Step) as discussed in the https://www.rabbitmq.com/ssl.html.

Also updated the rabbitMQ.config file as below:

[
  {rabbit, [
     {ssl_listeners, [5671]},
     {ssl_options, [
                    {cacertfile,"/etc/ca_certificate.pem"},
                    {certfile,"/etc/private_key.pem"},
                    {keyfile,"/etc/server_certificate.pem"},
                    {password,  "MySecretPassword"},
                    {verify,verify_peer},
                    {fail_if_no_peer_cert,true}
            ]}
   ]}
].

Steps followed to create the certificates on WINDOWS MACHINE:

Bash Cmd Prompt:

cd /C/temp/ThirdOne
mkdir testca
cd testca
mkdir certs private
chmod 700 private
echo 01 > serial
touch index.txt

Using OpenSSL CMD

openssl req -x509 -config openssl.cnf -newkey rsa:2048 -days 365 -out ca_certificate.pem -outform PEM -subj /CN=MyTestCA/ -nodes

openssl x509 -in ca_certificate.pem -out ca_certificate.cer -outform DER

mkdir server

cd server

openssl genrsa -out private_key.pem 2048

openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=desktop-s08pnk3/O=server/ -nodes

cd..

openssl ca -config openssl.cnf -in ./server/req.pem -out ./server/server_certificate.pem -notext -batch -extensions server_ca_extensions

openssl pkcs12 -export -out ./server/server_certificate.p12 -in ./server/server_certificate.pem -inkey ./server/private_key.pem -passout pass:MySecretPassword

mkdir client

cd client

openssl genrsa -out private_key.pem 2048

openssl req -new -key private_key.pem -out req.pem -outform PEM -subj /CN=desktop-s08pnk3/O=client/ -nodes

cd..

openssl ca -config openssl.cnf -in ./client/req.pem -out ./client/client_certificate.pem -notext -batch -extensions client_ca_extensions

openssl pkcs12 -export -out ./client/client_certificate.p12 -in ./client/client_certificate.pem -inkey ./client/private_key.pem -passout pass:MySecretPassword

On top of it I installed the certificate of client on Local.

NOTE: My client and server are both are local machine only.

Code that I am using for connecting to rabbit MQ:

 private static void RabbitMQWithSSLEnable()
        {
            try
            {
                string rabbitmqHostName = "desktop-s08pnk3";
                string rabbitmqServerName = "desktop-s08pnk3";
                string certificateFilePath = @"C:\temp\ThirdOne\client\client_certificate.pem";
                string certificatePassphrase = "MySecretPassword";
                string rabbitmqUsername = "test";
                string rabbitmqPassword = "test";

                var factory = new ConnectionFactory();

                factory.HostName = rabbitmqHostName;
                factory.UserName = rabbitmqUsername;
                factory.Password = rabbitmqPassword;

                //factory.Uri = new Uri("amqps://test:test@desktop-s08pnk3");

                factory.AuthMechanisms = new IAuthMechanismFactory[] { new ExternalMechanismFactory() };

                // Note: This should NEVER be "localhost"
                factory.Ssl.ServerName = rabbitmqServerName;

                // Path to my .p12 file.
                factory.Ssl.CertPath = certificateFilePath;
                // Passphrase for the certificate file - set through OpenSSL
                factory.Ssl.CertPassphrase = certificatePassphrase;

                factory.Ssl.Enabled = true;
                // Make sure TLS 1.2 is supported & enabled by your operating system
                factory.Ssl.Version = SslProtocols.Tls12;

                // This is the default RabbitMQ secure port
                factory.Port = AmqpTcpEndpoint.UseDefaultPort;
                factory.VirtualHost = "/";
                factory.Ssl.AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateChainErrors | SslPolicyErrors.RemoteCertificateNameMismatch | SslPolicyErrors.RemoteCertificateNotAvailable;

                //System.Net.ServicePointManager.Expect100Continue = false;

                using (var connection = factory.CreateConnection())
                {
                    using (var channel = connection.CreateModel())
                    {
                        // publish some messages...
                    }
                }
            }
            catch (System.Exception ex)
            {
                var error = ex.ToString();
                System.Console.WriteLine(error);
            }
        }

The above code is throwing error:

RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable
 ---> System.AggregateException: One or more errors occurred. (Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..)
 ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..
 ---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
   --- End of inner exception stack trace ---
   at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStream.ProcessAuthentication(LazyAsyncResult lazyResult, CancellationToken cancellationToken)
   at System.Net.Security.SslStream.BeginAuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.Security.SslStream.BeginAuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__64_1(String arg1, X509CertificateCollection arg2, SslProtocols arg3, AsyncCallback callback, Object state)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2,TArg3](Func`6 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2,TArg3](Func`6 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state)
   at System.Net.Security.SslStream.AuthenticateAsClientAsync(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at RabbitMQ.Client.Impl.SslHelper.<>c__DisplayClass2_0.<TcpUpgrade>b__0(SslOption opts)
   at RabbitMQ.Client.Impl.SslHelper.TcpUpgrade(Stream tcpStream, SslOption options)
   at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, Func`2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout)
   at RabbitMQ.Client.Framing.Impl.IProtocolExtensions.CreateFrameHandler(IProtocol protocol, AmqpTcpEndpoint endpoint, ArrayPool`1 pool, Func`2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout)
   at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler(AmqpTcpEndpoint endpoint)
   at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
   --- End of inner exception stack trace ---
   at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
   at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
   --- End of inner exception stack trace ---
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName)
   at RabbitMQ.Client.ConnectionFactory.CreateConnection()
   at RabbitMQ.Explore.Program.RabbitMQWithSSLEnable() in C:\Users\warke\source\repos\RabbitMQ.Explore\RabbitMQ.Explore\Program.cs:line 71

Can anyone please help me to get it resolved?

Thanks.

Below are the things that I tried:

A) Enabled the TLS on internet options.
B) Enabled Ports also.

@Team FYI and Questions:

I installed the client certificate on my local - Not sure on it
as it's not mentioned.

Do I need to installed the Server
Certificate on my local as I am trying to connect to it from local (client and server both are same machine)

I need to do Peer verification, so created both client and server certificate.

The password added in config and while calling the rabbitMQ on from local is the same which I used to create the certificate for Client and Server.

I created a new user for connection i.e. test and given the admin access to it.


来源: stackexchange

问:
I can't eas build --platform android Execution failed for task ':app:mergeReleaseResources'
In my expo sdk version 47, when I eas build in root directory it shows Execution failed for task ':app:mergeReleaseResources'.
how will i solve?

my app.json folder is

```<code>{
  "expo": {
    "name": "ebibaaha",
    "slug": "ebibaaha",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "myapp",
    "userInterfaceStyle": "automatic",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.ebibaaha.app",
      "permissions": [
        "CAMERA",
        "CAMERA_ROLL"
      ]
    },
    "web": {
      "favicon": "./assets/images/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "97cd307d-920a-4056-a550-0770aa4afaef"
      }
    }
  }
}
</code>```

enter image description here

I tried eas build --platform android to build my expo react native app but it show error.

ContentLicense: CC BY-SA 4.0

Body:
In my expo sdk version 47, when I eas build in root directory it shows Execution failed for task ':app:mergeReleaseResources'.
how will i solve?

my app.json folder is

{
  "expo": {
    "name": "ebibaaha",
    "slug": "ebibaaha",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "myapp",
    "userInterfaceStyle": "automatic",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.ebibaaha.app",
      "permissions": [
        "CAMERA",
        "CAMERA_ROLL"
      ]
    },
    "web": {
      "favicon": "./assets/images/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "97cd307d-920a-4056-a550-0770aa4afaef"
      }
    }
  }
}

enter image description here

I tried eas build --platform android to build my expo react native app but it show error.


问:
org.apache.commons.vfs2.FileSystemException: Could not create file in Pentaho Data Integration/Kettle ETL job execution
I'm trying to download a file with HTTP get to my local machine with Kettle, and I created two files. The first one is test_transformation.ktr, which defines two variables, local_file_path and URL,and passes them down by the following two steps:

```<code>Generate Rows -> Copy rows to result
</code>```

The second file is http_download_test.kjb, which contains the following steps (the transformation used here is the test_transformation.ktr previously mentioned and I ticked the Copy results to parameters checkbox)
I used ${URL} for the URL field in HTTP step and ${local_file_path} for the Target file field.

```<code>Start -> Transformation -> HTTP
</code>```

Both files are put under

```<code>D:\software\pdi-ce-9.3.0.0-428\data-integration\TESTS
</code>```

, and when I start the job, I could see that the value for

```<code>Internal.Entry.Current.Directory
Internal.Job.Filename.Directory
Internal.Job.Repository.Directory
</code>```

are all

```<code>file:///D:/software/pdi-ce-9.3.0.0-428/data-integration/TESTS
</code>```

However when I tried to run the job, I got the error org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration" at the HTTP step, detailed log as the following:

```<code>2022/12/26 17:03:32 - HTTP - Start of HTTP job entry.
2022/12/26 17:03:32 - HTTP - Connecting to URL:
2022/12/26 17:03:32 - HTTP - ERROR (version 9.3.0.0-428, build 9.3.0.0-428 from 2022-04-12 04.56.25 by buildguy) : Error getting file from HTTP :
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP - ERROR (version 9.3.0.0-428, build 9.3.0.0-428 from 2022-04-12 04.56.25 by buildguy) : org.pentaho.di.core.exception.KettleFileException:
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:390)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.entries.http.JobEntryHTTP.execute(JobEntryHTTP.java:518)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:703)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:844)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:844)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:513)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.run(Job.java:393)
2022/12/26 17:03:32 - HTTP - Caused by: org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -    at org.apache.commons.vfs2.provider.AbstractFileObject.createFile(AbstractFileObject.java:330)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:360)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:388)
2022/12/26 17:03:32 - HTTP -    ... 6 more
2022/12/26 17:03:32 - HTTP - Caused by: org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -    at org.apache.commons.vfs2.provider.AbstractFileObject.createFile(AbstractFileObject.java:320)
2022/12/26 17:03:32 - HTTP -    ... 8 more
2022/12/26 17:03:32 - http_download_test - Finished job entry [HTTP] (result=[false])
</code>```

I initially set local_file_path under the same directory, something like

```<code>D:\software\pdi-ce-9.3.0.0-428\data-integration\TESTS\sample.txt
</code>```

and later tried to move it to some different directory like

```<code>C:\Users\admin\Downloads
</code>```

I've checked that all roles/privileges (sorry I'm not using an English system so I'm not sure what it's called, hope I'm making myself clear) in

```<code>D:\software
</code>```

are enabled for all users, and also tried to run kettle as Administrator, but still got the same error.

Also, I tried to manually modify the Internal.xxx.xxx.Directory variables when starting my job (though I was told you can't manually set them) to make sure it's not an issue about "\" and "/" separators.

I'm using Pentaho Community Version 9.3.0.0-428, 64-bit Windows 10, and tried both Java 8 and Java 11.
Any help would be much appreciated. Thank you!

Body:
I'm trying to download a file with HTTP get to my local machine with Kettle, and I created two files. The first one is test_transformation.ktr, which defines two variables, local_file_path and URL,and passes them down by the following two steps:

Generate Rows -> Copy rows to result

The second file is http_download_test.kjb, which contains the following steps (the transformation used here is the test_transformation.ktr previously mentioned and I ticked the Copy results to parameters checkbox)
I used ${URL} for the URL field in HTTP step and ${local_file_path} for the Target file field.

Start -> Transformation -> HTTP

Both files are put under

D:\software\pdi-ce-9.3.0.0-428\data-integration\TESTS

, and when I start the job, I could see that the value for

Internal.Entry.Current.Directory
Internal.Job.Filename.Directory
Internal.Job.Repository.Directory

are all

file:///D:/software/pdi-ce-9.3.0.0-428/data-integration/TESTS

However when I tried to run the job, I got the error org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration" at the HTTP step, detailed log as the following:

2022/12/26 17:03:32 - HTTP - Start of HTTP job entry.
2022/12/26 17:03:32 - HTTP - Connecting to URL:
2022/12/26 17:03:32 - HTTP - ERROR (version 9.3.0.0-428, build 9.3.0.0-428 from 2022-04-12 04.56.25 by buildguy) : Error getting file from HTTP :
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP - ERROR (version 9.3.0.0-428, build 9.3.0.0-428 from 2022-04-12 04.56.25 by buildguy) : org.pentaho.di.core.exception.KettleFileException:
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP - Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:390)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.entries.http.JobEntryHTTP.execute(JobEntryHTTP.java:518)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:703)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:844)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:844)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.execute(Job.java:513)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.job.Job.run(Job.java:393)
2022/12/26 17:03:32 - HTTP - Caused by: org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -    at org.apache.commons.vfs2.provider.AbstractFileObject.createFile(AbstractFileObject.java:330)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:360)
2022/12/26 17:03:32 - HTTP -    at org.pentaho.di.core.vfs.KettleVFS.getOutputStream(KettleVFS.java:388)
2022/12/26 17:03:32 - HTTP -    ... 6 more
2022/12/26 17:03:32 - HTTP - Caused by: org.apache.commons.vfs2.FileSystemException: Could not create file "file:///D:/software/pdi-ce-9.3.0.0-428/data-integration".
2022/12/26 17:03:32 - HTTP -    at org.apache.commons.vfs2.provider.AbstractFileObject.createFile(AbstractFileObject.java:320)
2022/12/26 17:03:32 - HTTP -    ... 8 more
2022/12/26 17:03:32 - http_download_test - Finished job entry [HTTP] (result=[false])

I initially set local_file_path under the same directory, something like

D:\software\pdi-ce-9.3.0.0-428\data-integration\TESTS\sample.txt

and later tried to move it to some different directory like

C:\Users\admin\Downloads

I've checked that all roles/privileges (sorry I'm not using an English system so I'm not sure what it's called, hope I'm making myself clear) in

D:\software

are enabled for all users, and also tried to run kettle as Administrator, but still got the same error.

Also, I tried to manually modify the Internal.xxx.xxx.Directory variables when starting my job (though I was told you can't manually set them) to make sure it's not an issue about "\" and "/" separators.

I'm using Pentaho Community Version 9.3.0.0-428, 64-bit Windows 10, and tried both Java 8 and Java 11.
Any help would be much appreciated. Thank you!


问:
WinHttp websockets listener
I am trying to develop a WebSockets client in C++ using WinHttp. I am making very slow progress (I am .NET developer). I have my WS server developed in .NET 6 and now I am working on a C++ console app that connects to the server and listens for messages.

So far I successfully connect to the server and upgrade the connection to WS but struggle setting up the callback that triggers when a new message was sent from the server. I spent hours finding an example with no success.

Can someone please help me how to set the callback for the below code or provide me with a working example?

```<code>static void CALLBACK Callback(HINTERNET handle,
    DWORD_PTR context,
    DWORD code,
    void* info,
    DWORD length)
{
    switch (code) {

        case WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE:
        {
            int i = 0;
            break;
        }

        case WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED:
        {
            int i = 0;
            break;
        }

        case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE:
        {
            int i = 0;
            break;
        }

    default:
        {
        }
    }

    if (0 != context)
    {

    }
}

int main()
{

    DWORD dwError = ERROR_SUCCESS;
    BOOL fStatus = FALSE;
    DWORD dwSize = 0;
    DWORD dwDownloaded = 0;
    LPSTR pszOutBuffer;
    BOOL  bResults = FALSE;
    HINTERNET  hSession = NULL, hConnect = NULL, hRequest = NULL, hWebSocket = NULL;

    // Use WinHttpOpen to obtain a session handle.
    hSession = WinHttpOpen(L"WinHTTP Example/1.0",
        WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
        WINHTTP_NO_PROXY_NAME,
        WINHTTP_NO_PROXY_BYPASS,
        0);
    //WINHTTP_FLAG_ASYNC);

    if (hSession == NULL)
    {
        dwError = GetLastError();
    }

    // Setup the status callback function.
    WINHTTP_STATUS_CALLBACK isCallback = WinHttpSetStatusCallback(hSession,
        (WINHTTP_STATUS_CALLBACK)Callback,
        WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS,
        NULL);

    hConnect = WinHttpConnect(hSession, L"localhost", 5004, 0);

    if (hConnect == NULL)
    {
        dwError = GetLastError();
    }

    // Create an HTTP request handle.
    if (hConnect)
        hRequest = WinHttpOpenRequest(hConnect,
            L"GET",
            L"/ws",
            NULL,
            WINHTTP_NO_REFERER,
            WINHTTP_DEFAULT_ACCEPT_TYPES,
            0);//WINHTTP_FLAG_SECURE); // flags

    if (hRequest == NULL)
    {
        dwError = GetLastError();
    }

    //
    // Request protocol upgrade from http to websocket.
    //
#pragma prefast(suppress:6387, "WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET does not take any arguments.")
    fStatus = WinHttpSetOption(hRequest,
        WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET,
        NULL,
        0);

    if (!fStatus)
    {
        dwError = GetLastError();
    }

    // Send a request.
    if (hRequest)
        fStatus = WinHttpSendRequest(hRequest,
            WINHTTP_NO_ADDITIONAL_HEADERS,
            0,
            WINHTTP_NO_REQUEST_DATA,
            0,  // request data length
            0,  // total length
            0); // context

    if (!fStatus)
    {
        dwError = GetLastError();
    }

    fStatus = WinHttpReceiveResponse(hRequest, 0);

    if (!fStatus)
    {
        dwError = GetLastError();
    }

    //
    // Application should check what is the HTTP status code returned by the server and behave accordingly.
    // WinHttpWebSocketCompleteUpgrade will fail if the HTTP status code is different than 101.
    //
    hWebSocket = WinHttpWebSocketCompleteUpgrade(hRequest, NULL);

    if (hWebSocket == NULL)
    {
        dwError = GetLastError();
    }

    //
    // The request handle is not needed anymore. From now on we will use the websocket handle.
    //
    WinHttpCloseHandle(hRequest);
    hRequest = NULL;

    std::cout << "Connected to WS!\n";

}
</code>```

Title: WinHttp websockets listener

Body:
I am trying to develop a WebSockets client in C++ using WinHttp. I am making very slow progress (I am .NET developer). I have my WS server developed in .NET 6 and now I am working on a C++ console app that connects to the server and listens for messages.

So far I successfully connect to the server and upgrade the connection to WS but struggle setting up the callback that triggers when a new message was sent from the server. I spent hours finding an example with no success.

Can someone please help me how to set the callback for the below code or provide me with a working example?

static void CALLBACK Callback(HINTERNET handle,
    DWORD_PTR context,
    DWORD code,
    void* info,
    DWORD length)
{
    switch (code) {

        case WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE:
        {
            int i = 0;
            break;
        }

        case WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED:
        {
            int i = 0;
            break;
        }

        case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE:
        {
            int i = 0;
            break;
        }

    default:
        {
        }
    }

    if (0 != context)
    {

    }
}

int main()
{

    DWORD dwError = ERROR_SUCCESS;
    BOOL fStatus = FALSE;
    DWORD dwSize = 0;
    DWORD dwDownloaded = 0;
    LPSTR pszOutBuffer;
    BOOL  bResults = FALSE;
    HINTERNET  hSession = NULL, hConnect = NULL, hRequest = NULL, hWebSocket = NULL;

    // Use WinHttpOpen to obtain a session handle.
    hSession = WinHttpOpen(L"WinHTTP Example/1.0",
        WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
        WINHTTP_NO_PROXY_NAME,
        WINHTTP_NO_PROXY_BYPASS,
        0);
    //WINHTTP_FLAG_ASYNC);

    if (hSession == NULL)
    {
        dwError = GetLastError();
    }

    // Setup the status callback function.
    WINHTTP_STATUS_CALLBACK isCallback = WinHttpSetStatusCallback(hSession,
        (WINHTTP_STATUS_CALLBACK)Callback,
        WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS,
        NULL);

    hConnect = WinHttpConnect(hSession, L"localhost", 5004, 0);

    if (hConnect == NULL)
    {
        dwError = GetLastError();
    }

    // Create an HTTP request handle.
    if (hConnect)
        hRequest = WinHttpOpenRequest(hConnect,
            L"GET",
            L"/ws",
            NULL,
            WINHTTP_NO_REFERER,
            WINHTTP_DEFAULT_ACCEPT_TYPES,
            0);//WINHTTP_FLAG_SECURE); // flags

    if (hRequest == NULL)
    {
        dwError = GetLastError();
    }

    //
    // Request protocol upgrade from http to websocket.
    //
#pragma prefast(suppress:6387, "WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET does not take any arguments.")
    fStatus = WinHttpSetOption(hRequest,
        WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET,
        NULL,
        0);

    if (!fStatus)
    {
        dwError = GetLastError();
    }

    // Send a request.
    if (hRequest)
        fStatus = WinHttpSendRequest(hRequest,
            WINHTTP_NO_ADDITIONAL_HEADERS,
            0,
            WINHTTP_NO_REQUEST_DATA,
            0,  // request data length
            0,  // total length
            0); // context

    if (!fStatus)
    {
        dwError = GetLastError();
    }

    fStatus = WinHttpReceiveResponse(hRequest, 0);

    if (!fStatus)
    {
        dwError = GetLastError();
    }

    //
    // Application should check what is the HTTP status code returned by the server and behave accordingly.
    // WinHttpWebSocketCompleteUpgrade will fail if the HTTP status code is different than 101.
    //
    hWebSocket = WinHttpWebSocketCompleteUpgrade(hRequest, NULL);

    if (hWebSocket == NULL)
    {
        dwError = GetLastError();
    }

    //
    // The request handle is not needed anymore. From now on we will use the websocket handle.
    //
    WinHttpCloseHandle(hRequest);
    hRequest = NULL;

    std::cout << "Connected to WS!\n";

}


问:
Git Dont push on github cause has un-exist large file
So i have a some problem with pushing on github and has error with using git lfs on file what does not exist inside a repository. something like that

I try find that file on filesystem - nothing
trying to find from git ls-files - nothing
and cached file doesn't have that file

what can i to do to find that and remove)


问:
How to stop chrome responsive inspector from changing the zoom?
enter image description here
i am working on a project, the screen size i want to work on is 1366x920
the problem is when i set it to this size the zoom turn to 93% or other value

i change it back to 100% the size change to other than height changes to something else other than 920
i tried this solutions :

selecting "Restore to defaults" in the Toggle device toolbar menu.

selected "Desktop (touch)"

List item

```<code><meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
</code>```

turned off the "Auto-adjust zoom".

i saw an old post but never been answered correctly, or the answers didn't solve the problem for me
any idea how to fix it ?

Body:
enter image description here
i am working on a project, the screen size i want to work on is 1366x920
the problem is when i set it to this size the zoom turn to 93% or other value

i change it back to 100% the size change to other than height changes to something else other than 920
i tried this solutions :

selecting "Restore to defaults" in the Toggle device toolbar menu.

selected "Desktop (touch)"

List item

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />

turned off the "Auto-adjust zoom".

i saw an old post but never been answered correctly, or the answers didn't solve the problem for me
any idea how to fix it ?


问:
Grafana bar chart
I am trying to create a bar chart on grafana in which it shows latency for two categories from a field which I query from the db. There are total three fields an hour field, category and an aggregate calculation. Basically I want hour field on X-axis and two bars to show aggregation for each category and aggregate field on Y-axis.

Currently it looks like this:

In the image below those marked in Red are the two categories. Lets say A,B. The latency is my aggregation marked in blue and the green mark is hour.

Basically, I want to achieve something like below image: Category A,B on x-axis wrt hour, and latency on y-axis.

This is my query:

```<code>select * from (
  select   extract(hour from event_datetime) Hour, category, (source_timedelta_s_ + pipeline_timedelta_s_) Latency from <table>
  where extract(date from event_datetime) = '2022-12-13' and  extract(hour from event_datetime) > 12
)
PIVOT (
   avg(Latency)
   FOR category IN ('A','B')
) t
order by t.Hour
</code>```

Your help will be appreciated thanks. Sorry If my explanation is confusing.

Title: Grafana bar chart

Body:
I am trying to create a bar chart on grafana in which it shows latency for two categories from a field which I query from the db. There are total three fields an hour field, category and an aggregate calculation. Basically I want hour field on X-axis and two bars to show aggregation for each category and aggregate field on Y-axis.

Currently it looks like this:

In the image below those marked in Red are the two categories. Lets say A,B. The latency is my aggregation marked in blue and the green mark is hour.

Basically, I want to achieve something like below image: Category A,B on x-axis wrt hour, and latency on y-axis.

This is my query:

select * from (
  select   extract(hour from event_datetime) Hour, category, (source_timedelta_s_ + pipeline_timedelta_s_) Latency from

  where extract(date from event_datetime) = '2022-12-13' and  extract(hour from event_datetime) > 12
)
PIVOT (
   avg(Latency)
   FOR category IN ('A','B')
) t
order by t.Hour

Your help will be appreciated thanks. Sorry If my explanation is confusing.


问:
How to remove on click routing in Elementor, Team Templates?
enter image description here This section is visualizing from backend.

enter image description here This is backend section

enter image description here This is Plugin

I want to remove click ( )  to but want to show the section as frontend.

I was trying using CSS but animation is not working.
I want to disable click on section.


问:
How do I get rid of all the unnecessary padding and margins in c3.js
I want to get rid of all the spacing basically, i.e the extra spaces for axes and legends and want the c3 lines to attach/fit to the div element.

I tried to use svg viewBox attribute for it to scale to fit the div, but it was not giving me the desired result


问:
Error set color button use state_press when when pressing 3 buttons at the same time in android
I have built a layout of 3 buttons, and I have set the colors for those 3 buttons to be in the default state and the state when pressed, everything is normal except that when pressing those 3 buttons at the same time, the color of 3 buttons have changed but do not return to the original default color, I don't know why, hope someone can help me.
Here is the code:

```<code>        button_1.setOnTouchListener((view, motionEvent) -> {
            checkTouch(motionEvent, button_1);
            return true;
        });
        button_2.setOnTouchListener((view, motionEvent) -> {
            checkTouch(motionEvent, button_2);
            return true;
        });
        button_3.setOnTouchListener((view, motionEvent) -> {
            checkTouch(motionEvent, button_3);
            return true;
        });

     public void checkTouch(MotionEvent motionEvent, AppCompatButton button){
         switch (motionEvent.getAction()){
            case MotionEvent.ACTION_DOWN:
                button.setPressed(true);
                break;
            case MotionEvent.ACTION_POINTER_DOWN:
                break;
            case MotionEvent.ACTION_UP:
                button.setPressed(false);
                break;
            case MotionEvent.ACTION_POINTER_UP:
                break;
            case MotionEvent.ACTION_MOVE:
                break;
        }
    }
</code>```

And here is the xml file to set the color for the 3 buttons:

```<code><?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed = "true">
        <shape android:shape = "oval">
            <solid android:color = "#1E90FF"/>
        </shape>
    </item>
    <item android:state_pressed = "false">
        <shape android:shape = "oval">
            <solid android:color = "#87CEFA"/>
        </shape>
    </item>
</selector>
</code>```

Body:
I have built a layout of 3 buttons, and I have set the colors for those 3 buttons to be in the default state and the state when pressed, everything is normal except that when pressing those 3 buttons at the same time, the color of 3 buttons have changed but do not return to the original default color, I don't know why, hope someone can help me.
Here is the code:

        button_1.setOnTouchListener((view, motionEvent) -> {
            checkTouch(motionEvent, button_1);
            return true;
        });
        button_2.setOnTouchListener((view, motionEvent) -> {
            checkTouch(motionEvent, button_2);
            return true;
        });
        button_3.setOnTouchListener((view, motionEvent) -> {
            checkTouch(motionEvent, button_3);
            return true;
        });

     public void checkTouch(MotionEvent motionEvent, AppCompatButton button){
         switch (motionEvent.getAction()){
            case MotionEvent.ACTION_DOWN:
                button.setPressed(true);
                break;
            case MotionEvent.ACTION_POINTER_DOWN:
                break;
            case MotionEvent.ACTION_UP:
                button.setPressed(false);
                break;
            case MotionEvent.ACTION_POINTER_UP:
                break;
            case MotionEvent.ACTION_MOVE:
                break;
        }
    }

And here is the xml file to set the color for the 3 buttons:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed = "true">
        <shape android:shape = "oval">
            <solid android:color = "#1E90FF"/>
        </shape>
    </item>
    <item android:state_pressed = "false">
        <shape android:shape = "oval">
            <solid android:color = "#87CEFA"/>
        </shape>
    </item>
</selector>


问:
Using Apache Camel's ConsumerTemplate and ProducerTemplate in clean Camel application
Are there any real use cases for ConsumerTemplate and ProducerTemplate in a pure, "native" (i.e. no Spring Boot, etc.) Camel application?

Apart from tests, of course.


问:
Why my arm64 android emulator in android studio crashed?
I am unable to launch an arm64 android emulator at android studio 2021.3.1 Patch 1. I’m running it on Windows 11 with Intel i7 core.

Log output:

```<code>2022-12-26 15:48:08,948 [  20778]   INFO -       Emulator: Pixel 6 API 33 - C:\Users\dingy\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_API_33 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - emulator: INFO: Found systemPath C:\Users\dingy\AppData\Local\Android\Sdk\system-images\android-33\google_apis\arm64-v8a\
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host.
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - Process finished with exit code 1
2022-12-26 15:48:08,993 [  20823]  ERROR -       Emulator: Pixel 6 API 33 - Emulator terminated with exit code 1
</code>```

config.ini:

AvdId=Pixel_6_API_33
PlayStore.enabled=false
abi.type=arm64-v8a
avd.ini.displayname=Pixel 6 API 33
avd.ini.encoding=UTF-8
disk.dataPartition.size=800M
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes
hw.accelerometer=yes
hw.arc=false
hw.audioInput=yes
hw.battery=yes
hw.camera.back=virtualscene
hw.camera.front=emulated
hw.cpu.arch=arm64
hw.cpu.ncore=4
hw.dPad=no
hw.device.hash2=MD5:3db3250dab5d0d93b29353040181c7e9
hw.device.manufacturer=Google
hw.device.name=pixel_6
hw.gps=yes
hw.gpu.enabled=yes
hw.gpu.mode=auto
hw.initialOrientation=Portrait
hw.keyboard=yes
hw.lcd.density=420
hw.lcd.height=2400
hw.lcd.width=1080
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images\android-33\google_apis\arm64-v8a\
runtime.network.latency=none
runtime.network.speed=full
sdcard.size=512M
showDeviceFrame=yes
skin.dynamic=yes
skin.name=pixel_6
skin.path=C:\Users\dingy\AppData\Local\Android\Sdk\skins\pixel_6
tag.display=Google APIs
tag.id=google_apis
vm.heapSize=228
```
<p>I found android source:
https://android.googlesource.com/platform/external/qemu/+/1381d44efe69ba0b37fb7f7ef868125e279fc14a/android/emulator/main-emulator.cpp#910</p>
<pre class="lang-cpp prettyprint-override"><code>          if (sarch == "arm64" && apiLevel >=28) {
              APANIC("Avd's CPU Architecture '%s' is not supported by the QEMU2 emulator on x86_64 host.\n", avdarch);
          }
</code>```

And tried a API 27 image, it crashed:

```<code>2022-12-26 15:37:46,506 [1111142]   INFO -       Emulator: Pixel 6 API 27 - C:\Users\dingy\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_API_27 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-12-26 15:37:46,533 [1111169]   INFO -       Emulator: Pixel 6 API 27 - Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
2022-12-26 15:37:46,533 [1111169]   INFO -       Emulator: Pixel 6 API 27 - emulator: INFO: Found systemPath C:\Users\dingy\AppData\Local\Android\Sdk\system-images\android-27\google_apis\arm64-v8a\
2022-12-26 15:37:47,096 [1111732]   WARN -       Emulator: Pixel 6 API 27 - Failed to process .ini file C:\Users\dingy\.android\avd\Pixel_6_API_27.avd\quickbootChoice.ini for reading.
2022-12-26 15:37:47,191 [1111827]   INFO -       Emulator: Pixel 6 API 27 - Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
2022-12-26 15:37:47,191 [1111827]   INFO -       Emulator: Pixel 6 API 27 - IPv4 server found: 192.168.1.1
2022-12-26 15:37:47,219 [1111855]   INFO - ab.VirtualDeviceChangeListener - emulator-5554 connected
2022-12-26 15:37:47,219 [1111855]   WARN -       Emulator: Pixel 6 API 27 - *** Basic token auth will be deprecated soon, please migrate to using -grpc-use-jwt ***
2022-12-26 15:37:47,220 [1111856]   INFO -       Emulator: Pixel 6 API 27 - Started GRPC server at 127.0.0.1:8554, security: Local, auth: +token
2022-12-26 15:37:47,470 [1112106]   INFO -       Emulator: Pixel 6 API 27 - Advertising in: C:\Users\dingy\AppData\Local\Temp\avd\running\pid_2292.ini
2022-12-26 15:37:47,474 [1112110]   INFO -       Emulator: Pixel 6 API 27 - C:\Users\dingy\AppData\Loc
2022-12-26 15:37:47,474 [1112110]   INFO -       Emulator: Pixel 6 API 27 - al\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-aarch64.exe: PCI bus not available for hda
2022-12-26 15:37:47,537 [1112173]   WARN - ea.emulator.EmulatorController - android.emulation.control.EmulatorController/getDisplayConfigurations call failed - FAILED_PRECONDITION: The multi-display feature is not available
2022-12-26 15:39:17,909 [1202545]   INFO - il.indexing.FileBasedIndexImpl - Health check heartbeat
2022-12-26 15:39:37,093 [1221729]  ERROR -       Emulator: Pixel 6 API 27 - detected a hanging thread 'QEMU2 main loop'. No response for 109874 ms
2022-12-26 15:39:37,093 [1221729]  ERROR -       Emulator: Pixel 6 API 27 - Android Studio Dolphin | 2021.3.1 Patch 1  Build #AI-213.7172.25.2113.9123335
2022-12-26 15:39:37,096 [1221732]  ERROR -       Emulator: Pixel 6 API 27 - JDK: 11.0.13; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-12-26 15:39:37,096 [1221732]  ERROR -       Emulator: Pixel 6 API 27 - OS: Windows 11
</code>```

Then I tried opening emulator.exe with IDA Pro, modify cmp     esi, 27 with cmp     esi, 999 at .text:0000000140002B3F, and patch it.
It crashed again:

```<code>2022-12-26 16:41:17,662 [1055922]   INFO -       Emulator: Pixel 6 API 27 - C:\Users\dingy\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_API_27 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-12-26 16:41:17,683 [1055943]   INFO -       Emulator: Pixel 6 API 27 - Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
2022-12-26 16:41:17,683 [1055943]   INFO -       Emulator: Pixel 6 API 27 - emulator: INFO: Found systemPath C:\Users\dingy\AppData\Local\Android\Sdk\system-images\android-27\google_apis\arm64-v8a\
2022-12-26 16:41:19,484 [1057744]   INFO -       Emulator: Pixel 6 API 27 - Process finished with exit code -1073741795 (0xC000001D)
2022-12-26 16:41:19,484 [1057744]  ERROR -       Emulator: Pixel 6 API 27 - Emulator terminated with exit code -1073741795
java.lang.Throwable: Emulator terminated with exit code -1073741795
</code>```

Body:
I am unable to launch an arm64 android emulator at android studio 2021.3.1 Patch 1. I’m running it on Windows 11 with Intel i7 core.

Log output:

2022-12-26 15:48:08,948 [  20778]   INFO -       Emulator: Pixel 6 API 33 - C:\Users\dingy\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_API_33 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - emulator: INFO: Found systemPath C:\Users\dingy\AppData\Local\Android\Sdk\system-images\android-33\google_apis\arm64-v8a\
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host.
2022-12-26 15:48:08,987 [  20817]   INFO -       Emulator: Pixel 6 API 33 - Process finished with exit code 1
2022-12-26 15:48:08,993 [  20823]  ERROR -       Emulator: Pixel 6 API 33 - Emulator terminated with exit code 1

config.ini:

AvdId=Pixel_6_API_33
PlayStore.enabled=false
abi.type=arm64-v8a
avd.ini.displayname=Pixel 6 API 33
avd.ini.encoding=UTF-8
disk.dataPartition.size=800M
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes
hw.accelerometer=yes
hw.arc=false
hw.audioInput=yes
hw.battery=yes
hw.camera.back=virtualscene
hw.camera.front=emulated
hw.cpu.arch=arm64
hw.cpu.ncore=4
hw.dPad=no
hw.device.hash2=MD5:3db3250dab5d0d93b29353040181c7e9
hw.device.manufacturer=Google
hw.device.name=pixel_6
hw.gps=yes
hw.gpu.enabled=yes
hw.gpu.mode=auto
hw.initialOrientation=Portrait
hw.keyboard=yes
hw.lcd.density=420
hw.lcd.height=2400
hw.lcd.width=1080
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images\android-33\google_apis\arm64-v8a\
runtime.network.latency=none
runtime.network.speed=full
sdcard.size=512M
showDeviceFrame=yes
skin.dynamic=yes
skin.name=pixel_6
skin.path=C:\Users\dingy\AppData\Local\Android\Sdk\skins\pixel_6
tag.display=Google APIs
tag.id=google_apis
vm.heapSize=228

I found android source:
https://android.googlesource.com/platform/external/qemu/+/1381d44efe69ba0b37fb7f7ef868125e279fc14a/android/emulator/main-emulator.cpp#910

          if (sarch == "arm64" && apiLevel >=28) {
              APANIC("Avd's CPU Architecture '%s' is not supported by the QEMU2 emulator on x86_64 host.\n", avdarch);
          }

And tried a API 27 image, it crashed:

2022-12-26 15:37:46,506 [1111142]   INFO -       Emulator: Pixel 6 API 27 - C:\Users\dingy\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_API_27 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-12-26 15:37:46,533 [1111169]   INFO -       Emulator: Pixel 6 API 27 - Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
2022-12-26 15:37:46,533 [1111169]   INFO -       Emulator: Pixel 6 API 27 - emulator: INFO: Found systemPath C:\Users\dingy\AppData\Local\Android\Sdk\system-images\android-27\google_apis\arm64-v8a\
2022-12-26 15:37:47,096 [1111732]   WARN -       Emulator: Pixel 6 API 27 - Failed to process .ini file C:\Users\dingy\.android\avd\Pixel_6_API_27.avd\quickbootChoice.ini for reading.
2022-12-26 15:37:47,191 [1111827]   INFO -       Emulator: Pixel 6 API 27 - Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
2022-12-26 15:37:47,191 [1111827]   INFO -       Emulator: Pixel 6 API 27 - IPv4 server found: 192.168.1.1
2022-12-26 15:37:47,219 [1111855]   INFO - ab.VirtualDeviceChangeListener - emulator-5554 connected
2022-12-26 15:37:47,219 [1111855]   WARN -       Emulator: Pixel 6 API 27 - *** Basic token auth will be deprecated soon, please migrate to using -grpc-use-jwt ***
2022-12-26 15:37:47,220 [1111856]   INFO -       Emulator: Pixel 6 API 27 - Started GRPC server at 127.0.0.1:8554, security: Local, auth: +token
2022-12-26 15:37:47,470 [1112106]   INFO -       Emulator: Pixel 6 API 27 - Advertising in: C:\Users\dingy\AppData\Local\Temp\avd\running\pid_2292.ini
2022-12-26 15:37:47,474 [1112110]   INFO -       Emulator: Pixel 6 API 27 - C:\Users\dingy\AppData\Loc
2022-12-26 15:37:47,474 [1112110]   INFO -       Emulator: Pixel 6 API 27 - al\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-aarch64.exe: PCI bus not available for hda
2022-12-26 15:37:47,537 [1112173]   WARN - ea.emulator.EmulatorController - android.emulation.control.EmulatorController/getDisplayConfigurations call failed - FAILED_PRECONDITION: The multi-display feature is not available
2022-12-26 15:39:17,909 [1202545]   INFO - il.indexing.FileBasedIndexImpl - Health check heartbeat
2022-12-26 15:39:37,093 [1221729]  ERROR -       Emulator: Pixel 6 API 27 - detected a hanging thread 'QEMU2 main loop'. No response for 109874 ms
2022-12-26 15:39:37,093 [1221729]  ERROR -       Emulator: Pixel 6 API 27 - Android Studio Dolphin | 2021.3.1 Patch 1  Build #AI-213.7172.25.2113.9123335
2022-12-26 15:39:37,096 [1221732]  ERROR -       Emulator: Pixel 6 API 27 - JDK: 11.0.13; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-12-26 15:39:37,096 [1221732]  ERROR -       Emulator: Pixel 6 API 27 - OS: Windows 11

Then I tried opening emulator.exe with IDA Pro, modify cmp     esi, 27 with cmp     esi, 999 at .text:0000000140002B3F, and patch it.
It crashed again:

2022-12-26 16:41:17,662 [1055922]   INFO -       Emulator: Pixel 6 API 27 - C:\Users\dingy\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_6_API_27 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2022-12-26 16:41:17,683 [1055943]   INFO -       Emulator: Pixel 6 API 27 - Android emulator version 31.3.14.0 (build_id 9322596) (CL:N/A)
2022-12-26 16:41:17,683 [1055943]   INFO -       Emulator: Pixel 6 API 27 - emulator: INFO: Found systemPath C:\Users\dingy\AppData\Local\Android\Sdk\system-images\android-27\google_apis\arm64-v8a\
2022-12-26 16:41:19,484 [1057744]   INFO -       Emulator: Pixel 6 API 27 - Process finished with exit code -1073741795 (0xC000001D)
2022-12-26 16:41:19,484 [1057744]  ERROR -       Emulator: Pixel 6 API 27 - Emulator terminated with exit code -1073741795
java.lang.Throwable: Emulator terminated with exit code -1073741795


问:
Prisma Migrate without losing all the data ( Add Prisma to Existing DB without losing all the data )
I am trying to use Prisma for my existing DB(PG). whenever I add or update the schema it ask me to clear all the data. For the Dev server it's fine but I can't let that happen for prod.

Right now PROD DB has 2 table (which I haven't mentioned in my schema)

I want to use prisma for PROD env with out losing all the data. What will be the ideal way to do it ?


问:
It's could not find the driver, even though I already migrate to create a table in database from laravel to postgresql
This is the view from browser.

This is successful seeding the databases, so it means I already have a driver in postgreSQL.

I expect that in the browser, I can display the data from database. I'm using laragon/wamp.

I apologies, this is my first time to ask a question


问:
Solving a rectangular system of nonlinear equations with GSL
I want to program a C++ code able to solve a set of equation systems which are generally nonlinear.

I am already able to solve a system of m equations with n variables using GSL when m = n by following its documentation.

However, often I have fewer equations than variables. Can I use the same functionality of GSL, or do I have to opt for a different approach or another library? Why is there not a section about solving rectangular systems in the documentation?

This is what I've tried:

```<code>#include <cmath>
#include <gsl/gsl_vector.h>
#include <iostream>
#include <gsl/gsl_multiroots.h>

void print_vector(gsl_vector *gsl) {
  printf("[");
  for (int r = 0; r < gsl->size; r++) {
    if (r != gsl->size - 1) {
      printf("%+.5f; ", gsl->data[r]);
    } else {
      printf("%+.5f", gsl->data[r]);
    }
  }
  printf("]\n");
}

int evaluate(const gsl_vector *x, void *params, gsl_vector *f) {
  const double x0 = gsl_vector_get(x, 0);
  const double x1 = gsl_vector_get(x, 1);
  const double x2 = gsl_vector_get(x, 2);

  const double y0 = 0.1 * pow(x0, 2) + 0.1 * pow(x1, 2) + 2 - x2;

  // alone not working
  gsl_vector_set(f, 0, y0);

  // with this not working
  // gsl_vector_set(f, 1, 0);
  // gsl_vector_set(f, 2, 0);

  // with this not working
  // gsl_vector_set(f, 1, y0);
  // gsl_vector_set(f, 2, y0);

  return GSL_SUCCESS;
}

int main() {
  const size_t n = 3;

  const gsl_multiroot_fsolver_type *T;
  T = gsl_multiroot_fsolver_hybrids; // "iteration is not making progress towards solution"
//  T = gsl_multiroot_fsolver_hybrid; // "iteration is not making progress towards solution"
//  T = gsl_multiroot_fsolver_broyden; // "gsl: lu.c:266: ERROR: matrix is singular"
//  T = gsl_multiroot_fsolver_dnewton; // "gsl: lu.c:147: ERROR: matrix is singular"
  gsl_multiroot_fsolver *s = gsl_multiroot_fsolver_alloc(T, n);

  gsl_multiroot_function f_multiroot_function = {evaluate, n, nullptr};

  gsl_vector *x_gsl = gsl_vector_alloc(n);
  gsl_vector_set(x_gsl, 0, 3.4);
  gsl_vector_set(x_gsl, 1, 2.7);
  gsl_vector_set(x_gsl, 2, 3.8);

  std::cout << "x_gsl: ";
  print_vector(x_gsl);

  gsl_multiroot_fsolver_set(s, &f_multiroot_function, x_gsl);

  int status;
  size_t iter = 0;
  do {
    iter++;
    status = gsl_multiroot_fsolver_iterate(s);

    std::cout << "s->x=" << std::endl;
    print_vector(s->x);

    if (status) {
      std::cout << "STOPPING: " << gsl_strerror(status) << "." << std::endl;
      break;
    }

    status = gsl_multiroot_test_residual(s->f, 1e-5);
  } while (status == GSL_CONTINUE && iter < 20);

  return 0;
}
</code>```

And this

```<code>x_gsl: [+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
STOPPING: iteration is not making progress towards solution.

Process finished with exit code 0
</code>```

or this

```<code>x_gsl: [+3.40000; +2.70000; +3.80000]
gsl: lu.c:147: ERROR: matrix is singular
Default GSL error handler invoked.

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
</code>```

is what I get.

Body:
I want to program a C++ code able to solve a set of equation systems which are generally nonlinear.

I am already able to solve a system of m equations with n variables using GSL when m = n by following its documentation.

However, often I have fewer equations than variables. Can I use the same functionality of GSL, or do I have to opt for a different approach or another library? Why is there not a section about solving rectangular systems in the documentation?

This is what I've tried:

#include <cmath>
#include <gsl/gsl_vector.h>
#include <iostream>
#include <gsl/gsl_multiroots.h>

void print_vector(gsl_vector *gsl) {
  printf("[");
  for (int r = 0; r < gsl->size; r++) {
    if (r != gsl->size - 1) {
      printf("%+.5f; ", gsl->data[r]);
    } else {
      printf("%+.5f", gsl->data[r]);
    }
  }
  printf("]\n");
}

int evaluate(const gsl_vector *x, void *params, gsl_vector *f) {
  const double x0 = gsl_vector_get(x, 0);
  const double x1 = gsl_vector_get(x, 1);
  const double x2 = gsl_vector_get(x, 2);

  const double y0 = 0.1 * pow(x0, 2) + 0.1 * pow(x1, 2) + 2 - x2;

  // alone not working
  gsl_vector_set(f, 0, y0);

  // with this not working
  // gsl_vector_set(f, 1, 0);
  // gsl_vector_set(f, 2, 0);

  // with this not working
  // gsl_vector_set(f, 1, y0);
  // gsl_vector_set(f, 2, y0);

  return GSL_SUCCESS;
}

int main() {
  const size_t n = 3;

  const gsl_multiroot_fsolver_type *T;
  T = gsl_multiroot_fsolver_hybrids; // "iteration is not making progress towards solution"
//  T = gsl_multiroot_fsolver_hybrid; // "iteration is not making progress towards solution"
//  T = gsl_multiroot_fsolver_broyden; // "gsl: lu.c:266: ERROR: matrix is singular"
//  T = gsl_multiroot_fsolver_dnewton; // "gsl: lu.c:147: ERROR: matrix is singular"
  gsl_multiroot_fsolver *s = gsl_multiroot_fsolver_alloc(T, n);

  gsl_multiroot_function f_multiroot_function = {evaluate, n, nullptr};

  gsl_vector *x_gsl = gsl_vector_alloc(n);
  gsl_vector_set(x_gsl, 0, 3.4);
  gsl_vector_set(x_gsl, 1, 2.7);
  gsl_vector_set(x_gsl, 2, 3.8);

  std::cout << "x_gsl: ";
  print_vector(x_gsl);

  gsl_multiroot_fsolver_set(s, &f_multiroot_function, x_gsl);

  int status;
  size_t iter = 0;
  do {
    iter++;
    status = gsl_multiroot_fsolver_iterate(s);

    std::cout << "s->x=" << std::endl;
    print_vector(s->x);

    if (status) {
      std::cout << "STOPPING: " << gsl_strerror(status) << "." << std::endl;
      break;
    }

    status = gsl_multiroot_test_residual(s->f, 1e-5);
  } while (status == GSL_CONTINUE && iter < 20);

  return 0;
}

And this

x_gsl: [+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
s->x=
[+3.40000; +2.70000; +3.80000]
STOPPING: iteration is not making progress towards solution.

Process finished with exit code 0

or this

x_gsl: [+3.40000; +2.70000; +3.80000]
gsl: lu.c:147: ERROR: matrix is singular
Default GSL error handler invoked.

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

is what I get.


问:
what is the best way to wrap a long word with pdfMake?
I need to print a very long word, but pdfmake does not break the word. So my word cannot be wrapped, which breaks the layout of my pdf

What is the best/easiest way for you to solve this ?


问:
Filter an elasticsearch result after an aggregation
I have this elasticsearch query that get every x-locations for which the number of documents (with timestamp gte 1 month ago) is greater than 5000. I'm also able to get the most recent data timestamp for each of these x-locations.

Is it possible to add an additional filter at the end of the query, in order to ignore all x-locations for which the most recent timestamp is older than 2 days ago?

The query:

```<code>GET /mypattern-*/_search
{
    "query": {
        "bool": {
            "must": [
                {"match": {"method": "GET"}},
                {
                    "range": {
                        "timestamp": {
                            "gte": "now-1M"
                        }
                    }
                }
            ]
        }
    },
    "aggs": {
        "location_terms": {
            "terms": {
                "field": "x-location.keyword",
                "min_doc_count": 500,
                "size": 1000,
                "order": {
                    "recent_timestamp": "desc"
                }
            },
            "aggs": {
                "recent_timestamp": {
                    "max": {
                        "field": "timestamp"
                    }
                }
            }
        }
    }
}
</code>```

Body:
I have this elasticsearch query that get every x-locations for which the number of documents (with timestamp gte 1 month ago) is greater than 5000. I'm also able to get the most recent data timestamp for each of these x-locations.

Is it possible to add an additional filter at the end of the query, in order to ignore all x-locations for which the most recent timestamp is older than 2 days ago?

The query:

GET /mypattern-*/_search
{
    "query": {
        "bool": {
            "must": [
                {"match": {"method": "GET"}},
                {
                    "range": {
                        "timestamp": {
                            "gte": "now-1M"
                        }
                    }
                }
            ]
        }
    },
    "aggs": {
        "location_terms": {
            "terms": {
                "field": "x-location.keyword",
                "min_doc_count": 500,
                "size": 1000,
                "order": {
                    "recent_timestamp": "desc"
                }
            },
            "aggs": {
                "recent_timestamp": {
                    "max": {
                        "field": "timestamp"
                    }
                }
            }
        }
    }
}


问:
Where to save and how to call a custom OpenCart module
I'm trying to write a custom module for OpenCart 4.0.1.1. My module is as below:

```<code><?php
class ControllerExtensionModuleProductList extends Controller {
  public function index() {
    $this->load->model('catalog/product');

    $products = $this->model_catalog_product->getProducts();

    $this->response->addHeader('Content-Type: application/json');
    $this->response->setOutput(json_encode($products));
  }
}
?>
</code>```

Where should I save this file and what is the url to run this file?

Also is there any extension template for this version of OpenCart?

Body:
I'm trying to write a custom module for OpenCart 4.0.1.1. My module is as below:

<?php
class ControllerExtensionModuleProductList extends Controller {
  public function index() {
    $this->load->model('catalog/product');

    $products = $this->model_catalog_product->getProducts();

    $this->response->addHeader('Content-Type: application/json');
    $this->response->setOutput(json_encode($products));
  }
}
?>

Where should I save this file and what is the url to run this file?

Also is there any extension template for this version of OpenCart?


问:
google drive and javascript
I have a folder in google drive. There are photos in the folder. So, I need every photo .png, .jpg in the folder showed in my website. No matter who looks it. Everyone can see them.

If I put a photo in the folder it will be showed in website. everyone who visit website can see my photos which is in folder which is in my google drive

Title: google drive and javascript


问:
Do I need to recreate a dataset for every pipeline run?
I'm currently following through the tutorial "https://cloud.google.com/vertex-ai/docs/pipelines/build-pipeline" to remind myself about Vertex pipeline format, and it uses the component:

ImageDatasetCreateOp

Every time I run the pipeline, it recreates the dataset, which takes a long time (10+ minutes). What is the recommended way to work with dataset objects? Is it really to recreate them every single pipeline run?

It's odd because I used to work with Vertex a year ago, and don't remember ever doing that, but I can't for the life of me find any reference to "create if not exists", or even how other people get around this online.

(what I tried: running the pipeline, it recreates the dataset every time, which is very time consuming)


问:
Laravel displays character as html number instead
```<code><a href="#" class="text-xl text-white font-bold">{{$name}}</a>
</code>```

I'm trying to show a resource's name on a card component, but when displaying it, the ' character always shows as ' instead. Using {!!$name!!} instead of {{$name}} shows the name correctly but the data being displayed is entered by the user and that leaves XSS vulnerabilities open?

The way I'm doing this is using components like

<x-resource-card name="{{$resource->resource_name}}"...

then simply using that in the component

{{$name}}

^ Should show Hello ' World instead.

Body:
{{$name}}

I'm trying to show a resource's name on a card component, but when displaying it, the ' character always shows as ' instead. Using {!!$name!!} instead of {{$name}} shows the name correctly but the data being displayed is entered by the user and that leaves XSS vulnerabilities open?

The way I'm doing this is using components like

<x-resource-card name="{{$resource->resource_name}}"...

then simply using that in the component

{{$name}}

^ Should show Hello ' World instead.


问:
SOLR directory failed to be deleted after switch form LRUCache to CaffeineCache
// May be the technical input of this is lacking of details (I know), but that is everything I can see.

My project is using SOLR for indexing. The app is being deployed in a K8s cluster, the solr data directory is mounted to an external directory, let's call

```<code>tmp/SolrHome/collection1/data
</code>```

Everything was working fine before, the indexes should be re-indexed everytime new version is deployed.

After upgrading Spring boot version from 2.6.8 to 2.7.3, there is this issue with SOLR indexes refreshing. The solr data directory cannot be deleted the first time new pod is deployed

```<code>...FaultException: Cannot delete dir '/tmp/SolrHome/collection1/data'
at ...org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
at com.mgmtp.ekis.hdimm.springboot.MimasApplication.main(MimasApplication.java:12)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: com.mgmtp.ekis.core.basis.FaultException: Cannot delete dir
'/tmp/SolrHome/collection1/data'
at ...
... 25 common frames omitted
Caused by: java.io.IOException: Unable to delete directory
/export/tmp/SolrHome/collection1/data/tlog.
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1581)
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2372)
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1679)
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1575)
at <my-project>.SolrIndexCleaner.purgeIndex(SolrIndexCleaner.java:33)
</code>```

The noticable change is the solrconfig.xml changed, from

```<code><filterCache class="solr.FastLRUCache"
</code>```

to

```<code><filterCache class="solr.CaffeineCache"
</code>```

These two are still being kept as old state:

```<code><queryResultCache class="solr.LRUCache"
                      size="512"
                      initialSize="512"
                      autowarmCount="0"/>

<documentCache class="solr.LRUCache"
                   size="512"
                   initialSize="512"
                   autowarmCount="0"/>
</code>```

I tested and realized that the issue will gone if I change them all to CaffeineCache

Any idea why this happening?

Body:
// May be the technical input of this is lacking of details (I know), but that is everything I can see.

My project is using SOLR for indexing. The app is being deployed in a K8s cluster, the solr data directory is mounted to an external directory, let's call

tmp/SolrHome/collection1/data

Everything was working fine before, the indexes should be re-indexed everytime new version is deployed.

After upgrading Spring boot version from 2.6.8 to 2.7.3, there is this issue with SOLR indexes refreshing. The solr data directory cannot be deleted the first time new pod is deployed

...FaultException: Cannot delete dir '/tmp/SolrHome/collection1/data'
at ...org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
at com.mgmtp.ekis.hdimm.springboot.MimasApplication.main(MimasApplication.java:12)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: com.mgmtp.ekis.core.basis.FaultException: Cannot delete dir
'/tmp/SolrHome/collection1/data'
at ...
... 25 common frames omitted
Caused by: java.io.IOException: Unable to delete directory
/export/tmp/SolrHome/collection1/data/tlog.
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1581)
at org.apache.commons.io.FileUtils.forceDelete(FileUtils.java:2372)
at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:1679)
at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1575)
at <my-project>.SolrIndexCleaner.purgeIndex(SolrIndexCleaner.java:33)

The noticable change is the solrconfig.xml changed, from

<filterCache class="solr.FastLRUCache"

to

<filterCache class="solr.CaffeineCache"

These two are still being kept as old state:

<queryResultCache class="solr.LRUCache"
                      size="512"
                      initialSize="512"
                      autowarmCount="0"/>

<documentCache class="solr.LRUCache"
                   size="512"
                   initialSize="512"
                   autowarmCount="0"/>

I tested and realized that the issue will gone if I change them all to CaffeineCache

Any idea why this happening?


问:
.NET Reflection: Type is resolved from Assembly, but not from Module
I have the following code which loads an assembly via LoadFile and tries to get a generic type from it (.NET 6):

```<code>using System.Reflection;

var assemblyPath = "D:\\jb_lifetimes\\JetBrains.Lifetimes.dll";
var typeName = "JetBrains.Util.Util.StaticsForType`1[[JetBrains.Threading.ByteBufferAsyncProcessor," +
               " JetBrains.Lifetimes, Version=777.0.0.0, Culture=neutral, PublicKeyToken=3c74c1a6a8683340]]";
var moduleName = "D:\\jb_lifetimes\\JetBrains.Lifetimes.dll";

var assembly = Assembly.LoadFile(assemblyPath);
var fromAssembly = assembly.GetType(typeName);

Console.WriteLine($"Module count: {assembly.Modules.Count()}");

var module = assembly.GetModules().First(m => m.FullyQualifiedName == moduleName);
Console.WriteLine($"Resolved module: {module}");

Console.WriteLine($"Types count in module: {module.GetTypes().Length}");
Console.WriteLine($"Types count in assembly: {assembly.GetTypes().Length}");

var fromModule = module.GetType(typeName);

Console.WriteLine($"From assembly: {fromAssembly}");
Console.WriteLine($"From module: {fromModule}");
</code>```

And get the following output:

```<code>Module count: 1
Resolved module: JetBrains.Lifetimes.dll
Types count in module: 316
Types count in assembly: 316
From assembly: JetBrains.Util.Util.StaticsForType`1[JetBrains.Threading.ByteBufferAsyncProcessor]
From module:
</code>```

Type is resolved when it is acquired from Assembly.GetType, but Module.GetType returns null, however there is only one module in this assembly, and it is successfully resolved.

I don't understand why the type cannot be resolved from the only module of the assembly when it is successfully resolved from the assembly itself.

Some other observations:

If I replace LoadFile with LoadFrom, type is resolved from module as well. I know about different load contexts, but can't understand how they can affect the observed behavior

If I replace type name with JetBrains.Util.Util.StaticsForType1[JetBrains.Threading.ByteBufferAsyncProcessor], it is also resolved from module even with LoadFile

Body:
I have the following code which loads an assembly via LoadFile and tries to get a generic type from it (.NET 6):

using System.Reflection;

var assemblyPath = "D:\\jb_lifetimes\\JetBrains.Lifetimes.dll";
var typeName = "JetBrains.Util.Util.StaticsForType`1[[JetBrains.Threading.ByteBufferAsyncProcessor," +
               " JetBrains.Lifetimes, Version=777.0.0.0, Culture=neutral, PublicKeyToken=3c74c1a6a8683340]]";
var moduleName = "D:\\jb_lifetimes\\JetBrains.Lifetimes.dll";

var assembly = Assembly.LoadFile(assemblyPath);
var fromAssembly = assembly.GetType(typeName);

Console.WriteLine($"Module count: {assembly.Modules.Count()}");

var module = assembly.GetModules().First(m => m.FullyQualifiedName == moduleName);
Console.WriteLine($"Resolved module: {module}");

Console.WriteLine($"Types count in module: {module.GetTypes().Length}");
Console.WriteLine($"Types count in assembly: {assembly.GetTypes().Length}");

var fromModule = module.GetType(typeName);

Console.WriteLine($"From assembly: {fromAssembly}");
Console.WriteLine($"From module: {fromModule}");

And get the following output:

Module count: 1
Resolved module: JetBrains.Lifetimes.dll
Types count in module: 316
Types count in assembly: 316
From assembly: JetBrains.Util.Util.StaticsForType`1[JetBrains.Threading.ByteBufferAsyncProcessor]
From module:

Type is resolved when it is acquired from Assembly.GetType, but Module.GetType returns null, however there is only one module in this assembly, and it is successfully resolved.

I don't understand why the type cannot be resolved from the only module of the assembly when it is successfully resolved from the assembly itself.

Some other observations:

If I replace LoadFile with LoadFrom, type is resolved from module as well. I know about different load contexts, but can't understand how they can affect the observed behavior

If I replace type name with JetBrains.Util.Util.StaticsForType1[JetBrains.Threading.ByteBufferAsyncProcessor], it is also resolved from module even with LoadFile


问:
SliverPersistentHeaderDelegate should collapse before the Remaining widgets scroll under it
I am trying to make SliverPersistentHeaderDelegate to collapse first and then the rest of the screen to scroll.

Here is the code.

```<code>class MyHomePage extends StatelessWidget {
  const MyHomePage({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        physics: const PageScrollPhysics(),
        slivers: [
          SliverPersistentHeader(
            pinned: true,
            delegate: SliverAppBarDelegate(),
          ),
          const SliverToBoxAdapter(
            child: SizedBox(height: 24),
          ),
          SliverPersistentHeader(
            pinned: true,
            delegate: SliverGreenMenuBarDelegate(),
          ),
          const SliverPadding(padding: EdgeInsets.only(bottom: 15)),
          SliverFillRemaining(
            child: SizedBox(
              height: 200,
              child: Container(
                color: Colors.amber,
              ),
            ),
          ),
        ],
      ),
    );
  }
}

class SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
  SliverAppBarDelegate();

  var expandedHeight = 220.0;

  @override
  double get maxExtent => expandedHeight;

  @override
  double get minExtent => kToolbarHeight + 20;

  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    var colorScheme = Theme.of(context).colorScheme;

    double radius() {
      if (!overlapsContent && shrinkOffset == 0.0) {
        return 20.0;
      } else {
        return 20 - shrinkOffset / 11;
      }
    }

    final Widget appBar = FlexibleSpaceBar.createSettings(
      minExtent: minExtent,
      maxExtent: maxExtent,
      currentExtent: math.max(minExtent, maxExtent - shrinkOffset),
      child: AppBar(
        actions: [
          IconButton(
            padding: const EdgeInsets.all(0),
            constraints: const BoxConstraints(),
            onPressed: () {},
            icon: const Icon(Icons.abc),
          ),
          Padding(
            padding: const EdgeInsets.only(right: 16, left: 35),
            child: IconButton(
              padding: const EdgeInsets.all(0),
              constraints: const BoxConstraints(),
              onPressed: () {},
              icon: const Icon(Icons.ac_unit_sharp),
            ),
          ),
        ],
        flexibleSpace: const FlexibleSpaceBar(
          expandedTitleScale: 1,
          titlePadding: EdgeInsets.only(top: 4, left: 56, right: 56),
          title: SafeArea(
            child: Text("Hello world"),
          ),
        ),
        elevation: 10,
        shadowColor: colorScheme.secondary.withOpacity(0.2),
        primary: true,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            bottomLeft: Radius.circular(radius()),
            bottomRight: Radius.circular(radius()),
          ),
        ),
      ),
    );
    return appBar;
  }
}

class SliverGreenMenuBarDelegate extends SliverPersistentHeaderDelegate {
  @override
  double get maxExtent => 75.0;

  @override
  double get minExtent => 40.0;

  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }

  @override
  Widget build(
    BuildContext context,
    double shrinkOffset,
    bool overlapsContent,
  ) {
    double horizontalPadding() {
      if (!overlapsContent && shrinkOffset == 0.0) {
        return 25.0;
      } else {
        return 25 - (shrinkOffset / 3);
      }
    }

    double cornerRadius() {
      if (!overlapsContent && shrinkOffset == 0.0) {
        return 15.0;
      } else {
        return 15 - shrinkOffset / 5;
      }
    }

    return FlexibleSpaceBar.createSettings(
      maxExtent: maxExtent,
      minExtent: minExtent,
      currentExtent: math.max(minExtent, maxExtent - shrinkOffset),
      isScrolledUnder: true,
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: horizontalPadding()),
        child: Container(
          decoration: BoxDecoration(
            color: Colors.green,
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(cornerRadius()),
              topRight: Radius.circular(cornerRadius()),
              bottomLeft: const Radius.circular(15),
              bottomRight: const Radius.circular(15),
            ),
          ),
        ),
      ),
    );
  }
}
</code>```

And here is the video.

Basically, what I want is the green part to collapse first and the yellow part to go under it.

How can I achieve this?

The end result should be as shown in the screenshots below.

Before Scroll
After scrool

Thank you in advance for the help!

Body:
I am trying to make SliverPersistentHeaderDelegate to collapse first and then the rest of the screen to scroll.

Here is the code.

class MyHomePage extends StatelessWidget {
  const MyHomePage({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        physics: const PageScrollPhysics(),
        slivers: [
          SliverPersistentHeader(
            pinned: true,
            delegate: SliverAppBarDelegate(),
          ),
          const SliverToBoxAdapter(
            child: SizedBox(height: 24),
          ),
          SliverPersistentHeader(
            pinned: true,
            delegate: SliverGreenMenuBarDelegate(),
          ),
          const SliverPadding(padding: EdgeInsets.only(bottom: 15)),
          SliverFillRemaining(
            child: SizedBox(
              height: 200,
              child: Container(
                color: Colors.amber,
              ),
            ),
          ),
        ],
      ),
    );
  }
}

class SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
  SliverAppBarDelegate();

  var expandedHeight = 220.0;

  @override
  double get maxExtent => expandedHeight;

  @override
  double get minExtent => kToolbarHeight + 20;

  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    var colorScheme = Theme.of(context).colorScheme;

    double radius() {
      if (!overlapsContent && shrinkOffset == 0.0) {
        return 20.0;
      } else {
        return 20 - shrinkOffset / 11;
      }
    }

    final Widget appBar = FlexibleSpaceBar.createSettings(
      minExtent: minExtent,
      maxExtent: maxExtent,
      currentExtent: math.max(minExtent, maxExtent - shrinkOffset),
      child: AppBar(
        actions: [
          IconButton(
            padding: const EdgeInsets.all(0),
            constraints: const BoxConstraints(),
            onPressed: () {},
            icon: const Icon(Icons.abc),
          ),
          Padding(
            padding: const EdgeInsets.only(right: 16, left: 35),
            child: IconButton(
              padding: const EdgeInsets.all(0),
              constraints: const BoxConstraints(),
              onPressed: () {},
              icon: const Icon(Icons.ac_unit_sharp),
            ),
          ),
        ],
        flexibleSpace: const FlexibleSpaceBar(
          expandedTitleScale: 1,
          titlePadding: EdgeInsets.only(top: 4, left: 56, right: 56),
          title: SafeArea(
            child: Text("Hello world"),
          ),
        ),
        elevation: 10,
        shadowColor: colorScheme.secondary.withOpacity(0.2),
        primary: true,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            bottomLeft: Radius.circular(radius()),
            bottomRight: Radius.circular(radius()),
          ),
        ),
      ),
    );
    return appBar;
  }
}

class SliverGreenMenuBarDelegate extends SliverPersistentHeaderDelegate {
  @override
  double get maxExtent => 75.0;

  @override
  double get minExtent => 40.0;

  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }

  @override
  Widget build(
    BuildContext context,
    double shrinkOffset,
    bool overlapsContent,
  ) {
    double horizontalPadding() {
      if (!overlapsContent && shrinkOffset == 0.0) {
        return 25.0;
      } else {
        return 25 - (shrinkOffset / 3);
      }
    }

    double cornerRadius() {
      if (!overlapsContent && shrinkOffset == 0.0) {
        return 15.0;
      } else {
        return 15 - shrinkOffset / 5;
      }
    }

    return FlexibleSpaceBar.createSettings(
      maxExtent: maxExtent,
      minExtent: minExtent,
      currentExtent: math.max(minExtent, maxExtent - shrinkOffset),
      isScrolledUnder: true,
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: horizontalPadding()),
        child: Container(
          decoration: BoxDecoration(
            color: Colors.green,
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(cornerRadius()),
              topRight: Radius.circular(cornerRadius()),
              bottomLeft: const Radius.circular(15),
              bottomRight: const Radius.circular(15),
            ),
          ),
        ),
      ),
    );
  }
}

And here is the video.

Basically, what I want is the green part to collapse first and the yellow part to go under it.

How can I achieve this?

The end result should be as shown in the screenshots below.

Before Scroll
After scrool

Thank you in advance for the help!


问:
How to use MongoDb sessions and transactions in a multilevel file structure
My File structure is like this :

Controllers -> Services -> Repositories -> Models

All the schema and models are saved in models.

All the db transactions happen in repositories

All the business logic is in services

All the data entry and error handling is finally done in controllers.

Now my question is :

How do I start a MongoDB session in controllers and make sure that the db transactions are provoked if any of the steps get a error. Do I pass the session object from each file or is there any better way?