问:
How to combine CSS Grid and ::before / ::after?
Basically I try to style a CSS grid and one of the features I want to implement is a rotating gradient as border.

I use the ::before and ::after pseudo-elements thereto.

I managed to implement it as a standalone but as soon as I add it to one of the grid cells it does not show anything. Want am I doing wrong?

Here is a minimal example:

:root {
  --main-radius: 30px;
  --main-padding: 20px;
}

.container {
  display: grid;
  height: 97vh;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "content1 content2 content3";
  grid-gap: 2rem;
  color: #004d40;
  text-align: center;
}

@property --rotate {
  syntax: "<angle>";
  initial-value: 132deg;
  inherits: false;
}

#content1 {
  background: #6fffd2;
  grid-area: content1;
  border-radius: var(--main-radius);
  padding-top: var(--main-padding);
}

.content1::before {
  content: "";
  margin-left: -5px;
  margin-bottom: -5px;
  border-radius: var(--main-radius);
  background-image: linear-gradient( var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
  position: absolute;
  z-index: -1;
  top: -1%;
  left: -2%;
  animation: spin 2.5s linear infinite;
}

.content1::after {
  position: absolute;
  content: "";
  top: 20px;
  left: 0;
  right: 0;
  z-index: -1;
  height: 100%;
  width: 100%;
  margin: 0 auto;
  transform: scale(0.8);
  filter: blur(20px);
  background-image: linear-gradient( var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
  opacity: 1;
  transition: opacity .5s;
  animation: spin 2.5s linear infinite;
}

@keyframes spin {
  0% {
    --rotate: 0deg;
  }
  100% {
    --rotate: 360deg;
  }
}

#content2 {
  background: #64ffda;
  grid-area: content2;
  border-radius: var(--main-radius);
  padding-top: var(--main-padding);
}

#content3 {
  background: #73ffba;
  grid-area: content3;
  border-radius: var(--main-radius);
  padding-top: var(--main-padding);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="container">
  <div id="content1">Content 1</div>
  <div id="content2">Content2</div>
  <div id="content3">Content3</div>
</div></code>```

Body:
Basically I try to style a CSS grid and one of the features I want to implement is a rotating gradient as border.

I use the ::before and ::after pseudo-elements thereto.

I managed to implement it as a standalone but as soon as I add it to one of the grid cells it does not show anything. Want am I doing wrong?

Here is a minimal example:

:root {
  --main-radius: 30px;
  --main-padding: 20px;
}

.container {
  display: grid;
  height: 97vh;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "content1 content2 content3";
  grid-gap: 2rem;
  color: #004d40;
  text-align: center;
}

@property --rotate {
  syntax: "<angle>";
  initial-value: 132deg;
  inherits: false;
}

#content1 {
  background: #6fffd2;
  grid-area: content1;
  border-radius: var(--main-radius);
  padding-top: var(--main-padding);
}

.content1::before {
  content: "";
  margin-left: -5px;
  margin-bottom: -5px;
  border-radius: var(--main-radius);
  background-image: linear-gradient( var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
  position: absolute;
  z-index: -1;
  top: -1%;
  left: -2%;
  animation: spin 2.5s linear infinite;
}

.content1::after {
  position: absolute;
  content: "";
  top: 20px;
  left: 0;
  right: 0;
  z-index: -1;
  height: 100%;
  width: 100%;
  margin: 0 auto;
  transform: scale(0.8);
  filter: blur(20px);
  background-image: linear-gradient( var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
  opacity: 1;
  transition: opacity .5s;
  animation: spin 2.5s linear infinite;
}

@keyframes spin {
  0% {
    --rotate: 0deg;
  }
  100% {
    --rotate: 360deg;
  }
}

#content2 {
  background: #64ffda;
  grid-area: content2;
  border-radius: var(--main-radius);
  padding-top: var(--main-padding);
}

#content3 {
  background: #73ffba;
  grid-area: content3;
  border-radius: var(--main-radius);
  padding-top: var(--main-padding);
}

Content 1

Content2

Content3


来源: stackexchange

问:
Using BufferBlock as Observable without consuming the elements
We use BufferBlocks to build a small simulation tool where we want to find areas that takes a long time to complete. Producers and Consumers of the blocks will essentially sleep for x amount of time and then post a message to another block.
We decided to use an Observer pattern. Howver, I see some behavior I did not expect. Whenever the OnNext method of the observers is called the BufferBlock is empty (Count == 0). This  is problematic as I want only 1 observer to be able to fetch the value from the queue.
Is there a way to change this behavior? If not, how should I handle consumption from the BufferBlocks?

Currently I want to be able to do something similar to post the messages and have all Observers try  to fetch it:

```<code>public void OnNext(Object value)
{
    var res =this.AsConsumer().ConsumeQueue.ReceiveAsync().Result;
    Thread.Sleep(this.TimeToConsume );
    ProduceQueue.Post(someOtherValue);
}
</code>```

I have written some tests to show the behavior of the BufferBlock.

```<code>[Test]
public void
WhenObservingMocks_CallsOnNextForAllMocks()
{
    var firstObserver = new Mock<IObserver<int>>();
    var secondObserver = new Mock<IObserver<int>>();
    var block = new BufferBlock<int>();

    block.AsObservable().Subscribe(firstObserver.Object);
    block.AsObservable().Subscribe(secondObserver.Object);

    block.Post(2);
    Thread.Sleep(TimeSpan.FromMilliseconds(50));
    firstObserver.Verify(e => e.OnNext(It.IsAny<int>()), Times.Once);
    secondObserver.Verify(e => e.OnNext(It.IsAny<int>()), Times.Once);
}

[Test]
public void
    WhenHavingObservers_DoesConsumesTheElementFromQueue()
{
    var firstObserver = new Mock<IObserver<int>>();
    var secondObserver = new Mock<IObserver<int>>();
    var block = new BufferBlock<int>();

    block.AsObservable().Subscribe(firstObserver.Object);
    block.AsObservable().Subscribe(secondObserver.Object);

    block.Post(2);
    Assert.Zero(block.Count);
}

[Test]
public void
    WhenPostingOnce_CanOnlyReceiveOnce()
{
    var block = new BufferBlock<int>();
    block.Post(2);
    Assert.True(block.TryReceive(out int _));
    Assert.False(block.TryReceive(out int _));
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
We use BufferBlocks to build a small simulation tool where we want to find areas that takes a long time to complete. Producers and Consumers of the blocks will essentially sleep for x amount of time and then post a message to another block.
We decided to use an Observer pattern. Howver, I see some behavior I did not expect. Whenever the OnNext method of the observers is called the BufferBlock is empty (Count == 0). This  is problematic as I want only 1 observer to be able to fetch the value from the queue.
Is there a way to change this behavior? If not, how should I handle consumption from the BufferBlocks?

Currently I want to be able to do something similar to post the messages and have all Observers try  to fetch it:

public void OnNext(Object value)
{
    var res =this.AsConsumer().ConsumeQueue.ReceiveAsync().Result;
    Thread.Sleep(this.TimeToConsume );
    ProduceQueue.Post(someOtherValue);
}

I have written some tests to show the behavior of the BufferBlock.

[Test]
public void
WhenObservingMocks_CallsOnNextForAllMocks()
{
    var firstObserver = new Mock<IObserver<int>>();
    var secondObserver = new Mock<IObserver<int>>();
    var block = new BufferBlock<int>();

    block.AsObservable().Subscribe(firstObserver.Object);
    block.AsObservable().Subscribe(secondObserver.Object);

    block.Post(2);
    Thread.Sleep(TimeSpan.FromMilliseconds(50));
    firstObserver.Verify(e => e.OnNext(It.IsAny<int>()), Times.Once);
    secondObserver.Verify(e => e.OnNext(It.IsAny<int>()), Times.Once);
}

[Test]
public void
    WhenHavingObservers_DoesConsumesTheElementFromQueue()
{
    var firstObserver = new Mock<IObserver<int>>();
    var secondObserver = new Mock<IObserver<int>>();
    var block = new BufferBlock<int>();

    block.AsObservable().Subscribe(firstObserver.Object);
    block.AsObservable().Subscribe(secondObserver.Object);

    block.Post(2);
    Assert.Zero(block.Count);
}

[Test]
public void
    WhenPostingOnce_CanOnlyReceiveOnce()
{
    var block = new BufferBlock<int>();
    block.Post(2);
    Assert.True(block.TryReceive(out int _));
    Assert.False(block.TryReceive(out int _));
}


问:
Why adding passport into laravel 9 app oauth/authorize route not found?
I'm trying to add passport("^11.3") support to my Laravel 9.19 app.

```<code>GET|HEAD        oauth/authorize ................................................................................................................... passport.authorizations.authorize › Laravel\Passport › AuthorizationController@authorize
  POST            oauth/authorize ................................................................................................................ passport.authorizations.approve › Laravel\Passport › ApproveAuthorizationController@approve
</code>```

Reading docks at https://laravel.com/docs/9.x/passport#installation
“Redirecting For Authorization” block with example code :

<?php
use Illuminate\Http\Request;
use Illuminate\Support\Str;

Route::get('/redirect', function (Request $request) {
    $request->session()->put('state', $state = Str::random(40));

    $query = http_build_query([
        'client_id' => 'client-id',
        'redirect_uri' => 'http://third-party-app.com/callback',
        'response_type' => 'code',
        'scope' => '',
        'state' => $state,
        // 'prompt' => '', // "none", "consent", or "login"
    ]);
});
```
<p>I added a GET request in postman:
<img src="https://i.stack.imgur.com/Ant37.png" alt="" />
which points to my site at local apache virtual host http://local-ms-votes.com</p>
<p>But I do not understand why I got 404(url not found) as in output of php artisan</p>
```route:list

GET|HEAD        oauth/authorize ................................................................................................................... passport.authorizations.authorize › Laravel\Passport › AuthorizationController@authorize
  POST            oauth/authorize ................................................................................................................ passport.authorizations.approve › Laravel\Passport › ApproveAuthorizationController@approve
```
<p>Is url</p>
```http://local-ms-votes.com/api/oauth/authorize?client_id=2&redirect_uri=http://local-ms-votes.com&response_type=code&scope&state=ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD
```
<p>not valid for route in route:list ?</p>
<p>File app/Providers/AuthServiceProvider.php has :</p>
```<?php

namespace App\Providers;

// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Passport;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The model to policy mappings for the application.
     *
     * @var array<class-string, class-string>
     */
    protected $policies = [
        // 'App\Models\Model' => 'App\Policies\ModelPolicy',
    ];

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();

        //
    }
}
```
<p>comparing with prior passport laravel app I see additive method used in boot :</p>
```public function boot()
{
    $this->registerPolicies();

    Passport::routes(); // I got Call to undefined method Laravel\Passport\Passport::routes() i error
}
```

I cleared the cache.

What is wrong?

Thanks!

Body:
I'm trying to add passport("^11.3") support to my Laravel 9.19 app.

GET|HEAD        oauth/authorize ................................................................................................................... passport.authorizations.authorize › Laravel\Passport › AuthorizationController@authorize
  POST            oauth/authorize ................................................................................................................ passport.authorizations.approve › Laravel\Passport › ApproveAuthorizationController@approve

Reading docks at https://laravel.com/docs/9.x/passport#installation
“Redirecting For Authorization” block with example code :

<?php
use Illuminate\Http\Request;
use Illuminate\Support\Str;

Route::get('/redirect', function (Request $request) {
    $request->session()->put('state', $state = Str::random(40));

    $query = http_build_query([
        'client_id' => 'client-id',
        'redirect_uri' => 'http://third-party-app.com/callback',
        'response_type' => 'code',
        'scope' => '',
        'state' => $state,
        // 'prompt' => '', // "none", "consent", or "login"
    ]);
});

I added a GET request in postman:

which points to my site at local apache virtual host http://local-ms-votes.com

But I do not understand why I got 404(url not found) as in output of php artisan

route:list

GET|HEAD        oauth/authorize ................................................................................................................... passport.authorizations.authorize › Laravel\Passport › AuthorizationController@authorize
  POST            oauth/authorize ................................................................................................................ passport.authorizations.approve › Laravel\Passport › ApproveAuthorizationController@approve

Is url

http://local-ms-votes.com/api/oauth/authorize?client_id=2&redirect_uri=http://local-ms-votes.com&response_type=code&scope&state=ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD

not valid for route in route:list ?

File app/Providers/AuthServiceProvider.php has :

<?php

namespace App\Providers;

// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Passport;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The model to policy mappings for the application.
     *
     * @var array<class-string, class-string>
     */
    protected $policies = [
        // 'App\Models\Model' => 'App\Policies\ModelPolicy',
    ];

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();

        //
    }
}

comparing with prior passport laravel app I see additive method used in boot :

public function boot()
{
    $this->registerPolicies();

    Passport::routes(); // I got Call to undefined method Laravel\Passport\Passport::routes() i error
}

I cleared the cache.

What is wrong?

Thanks!


问:
Problem to order a bar chart in a decreasing way
I have a DataFrame containing data about different projects. I tried to create a bar chart, representing the number of users for each project and this 'filtered' depending if the project has been audited before or after 2014.

My problem is that I would like to have all of the bars ranked from the biggest one to the smallest one, and not one on one side and the other one on the other side. I think it's quite hard to understand but with the following pictures, it will be much clearer.

I tried the following:

```<code>applications = applications.sort_values(by='NombreUtilisateur2017', ascending=False)

fig = px.bar(applications, x='AppCode', y='NombreUtilisateur2017', color='test_avant_2014')
fig.show()
</code>```

Here is my output:
current output

But, I would like my graph to look like this:
expected output

Body:
I have a DataFrame containing data about different projects. I tried to create a bar chart, representing the number of users for each project and this 'filtered' depending if the project has been audited before or after 2014.

My problem is that I would like to have all of the bars ranked from the biggest one to the smallest one, and not one on one side and the other one on the other side. I think it's quite hard to understand but with the following pictures, it will be much clearer.

I tried the following:

applications = applications.sort_values(by='NombreUtilisateur2017', ascending=False)

fig = px.bar(applications, x='AppCode', y='NombreUtilisateur2017', color='test_avant_2014')
fig.show()

Here is my output:
current output

But, I would like my graph to look like this:
expected output


问:
missing server hello message in SSL handshake, Received fatal alert: handshake_failure
java version 1.8.0_131

nginx configuration here:

```<code>ssl_certificate      /data/modules/nginx/conf/ssl/pem_file.pem;
  ssl_certificate_key   /data/modules/nginx/conf/ssl/key_file.key;
  ssl_session_timeout  5m;

  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384;
  ssl_prefer_server_ciphers off;
  add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
  add_header X-Frame-Options SAMEORIGIN;
</code>```

here is java.net debug log:

```<code>Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1.1
%% No cached client session
*** ClientHello, TLSv1.2
RandomCookie:  GMT: 1654921397 bytes = { 1, 222, 145, 27, 44, 211, 167, 223, 74, 229, 54, 135, 3, 192, 62, 79, 189, 146, 176, 31, 45, 192, 125, 13, 14, 73, 152, 75 }
Session ID:  {}
Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods:  { 0 }
Extension elliptic_curves, curve names: {secp256r1, secp384r1, secp521r1, sect283k1, sect283r1, sect409k1, sect409r1, sect571k1, sect571r1, secp256k1}
Extension ec_point_formats, formats: [uncompressed]
Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA256withDSA, SHA224withECDSA, SHA224withRSA, SHA224withDSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
Extension server_name, server_name: [type=host_name (0), value=www.test-api.com]
***
[write] MD5 and SHA1 hashes:  len = 200
.......[HEX CONTENT].........
device-state-schedule-1-2, WRITE: TLSv1.2 Handshake, length = 200
[Raw write]: length = 205
.......[HEX CONTENT].........
[Raw read]: length = 5
0000: 15 03 03 00 02                                     .....
[Raw read]: length = 2
0000: 02 28                                              .(
device-state-schedule-1-2, READ: TLSv1.2 Alert, length = 2
device-state-schedule-1-2, RECV TLSv1.2 ALERT:  fatal, handshake_failure
device-state-schedule-1-2, called closeSocket()
device-state-schedule-1-2, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
2022-12-22 16:47:49.203 DEBUG 99028 --- [te-schedule-1-2] c.x.c.c.l.Logger                         : ContextId [] XlinkPlatformConfigApiRemoteCall#getPlatformConfig(String,String)-<--- ERROR SSLHandshakeException: Received fatal alert: handshake_failure (419ms)
2022-12-22 16:47:49.204 DEBUG 99028 --- [te-schedule-1-2] c.x.c.c.l.Logger                         : ContextId [] XlinkPlatformConfigApiRemoteCall#getPlatformConfig(String,String)-javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at feign.httpclient.ApacheHttpClient.execute(ApacheHttpClient.java:83)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)
    at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
    at com.sun.proxy.$Proxy153.getPlatformConfig(Unknown Source)
    at cn.xlink.service.impl.ChirpStackPlatformConfigServiceImpl.getPlatformConfig(ChirpStackPlatformConfigServiceImpl.java:45)
    at cn.xlink.service.impl.ChirpStackPlatformConfigServiceImpl.getPlatformConfigParams(ChirpStackPlatformConfigServiceImpl.java:63)
    at cn.xlink.service.impl.GatewayDeviceServiceImpl.checkGatewaysDeviceState(GatewayDeviceServiceImpl.java:398)
    at cn.xlink.service.impl.GatewayDeviceServiceImpl$$FastClassBySpringCGLIB$$ecf68591.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at cn.xlink.service.impl.GatewayDeviceServiceImpl$$EnhancerBySpringCGLIB$$21970120.checkGatewaysDeviceState(<generated>)
    at cn.xlink.manager.DeviceClientManager.scheduleGatewayState(DeviceClientManager.java:473)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
</code>```

using feign to request other resources and there are no any options on feign and http client

the java application could not access the SSL handshake and there has no server hello message respond from server, any help please?

I try to import the cipher suite [ bcprov-ext-jdk15on-1.70.jar, bcprov-jdk15on-1.70.jar ] into the $JAVA_HOME/jre/lib/ext/ and append the provider [ org.bouncycastle.jce.provider.BouncyCastleProvider ] to the java.security in $JAVA_HOME/jre/lib/security/java.security also. but it's not work.

keytool -import -alias "server-ssl" -keystore $JAVA_HOME/jre/lib/security/cacerts -file server.cer

Then I import the server certificate to the java truststore but it's not work yet.

It is ok to open the url on browser and can be accessed by curl or openssl -connect also. It seems only failed on the java application request host:port. I think that might be something wrong on configuring jdk ssl certificate or cipher suite.

How can I check that my server and client configurations are correct?

Body:
java version 1.8.0_131

nginx configuration here:

ssl_certificate      /data/modules/nginx/conf/ssl/pem_file.pem;
  ssl_certificate_key   /data/modules/nginx/conf/ssl/key_file.key;
  ssl_session_timeout  5m;

  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384;
  ssl_prefer_server_ciphers off;
  add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
  add_header X-Frame-Options SAMEORIGIN;

here is java.net debug log:

Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1.1
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1.1
%% No cached client session
*** ClientHello, TLSv1.2
RandomCookie:  GMT: 1654921397 bytes = { 1, 222, 145, 27, 44, 211, 167, 223, 74, 229, 54, 135, 3, 192, 62, 79, 189, 146, 176, 31, 45, 192, 125, 13, 14, 73, 152, 75 }
Session ID:  {}
Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods:  { 0 }
Extension elliptic_curves, curve names: {secp256r1, secp384r1, secp521r1, sect283k1, sect283r1, sect409k1, sect409r1, sect571k1, sect571r1, secp256k1}
Extension ec_point_formats, formats: [uncompressed]
Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA256withDSA, SHA224withECDSA, SHA224withRSA, SHA224withDSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
Extension server_name, server_name: [type=host_name (0), value=www.test-api.com]
***
[write] MD5 and SHA1 hashes:  len = 200
.......[HEX CONTENT].........
device-state-schedule-1-2, WRITE: TLSv1.2 Handshake, length = 200
[Raw write]: length = 205
.......[HEX CONTENT].........
[Raw read]: length = 5
0000: 15 03 03 00 02                                     .....
[Raw read]: length = 2
0000: 02 28                                              .(
device-state-schedule-1-2, READ: TLSv1.2 Alert, length = 2
device-state-schedule-1-2, RECV TLSv1.2 ALERT:  fatal, handshake_failure
device-state-schedule-1-2, called closeSocket()
device-state-schedule-1-2, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
2022-12-22 16:47:49.203 DEBUG 99028 --- [te-schedule-1-2] c.x.c.c.l.Logger                         : ContextId [] XlinkPlatformConfigApiRemoteCall#getPlatformConfig(String,String)-<--- ERROR SSLHandshakeException: Received fatal alert: handshake_failure (419ms)
2022-12-22 16:47:49.204 DEBUG 99028 --- [te-schedule-1-2] c.x.c.c.l.Logger                         : ContextId [] XlinkPlatformConfigApiRemoteCall#getPlatformConfig(String,String)-javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at feign.httpclient.ApacheHttpClient.execute(ApacheHttpClient.java:83)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)
    at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
    at com.sun.proxy.$Proxy153.getPlatformConfig(Unknown Source)
    at cn.xlink.service.impl.ChirpStackPlatformConfigServiceImpl.getPlatformConfig(ChirpStackPlatformConfigServiceImpl.java:45)
    at cn.xlink.service.impl.ChirpStackPlatformConfigServiceImpl.getPlatformConfigParams(ChirpStackPlatformConfigServiceImpl.java:63)
    at cn.xlink.service.impl.GatewayDeviceServiceImpl.checkGatewaysDeviceState(GatewayDeviceServiceImpl.java:398)
    at cn.xlink.service.impl.GatewayDeviceServiceImpl$$FastClassBySpringCGLIB$$ecf68591.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at cn.xlink.service.impl.GatewayDeviceServiceImpl$$EnhancerBySpringCGLIB$$21970120.checkGatewaysDeviceState(<generated>)
    at cn.xlink.manager.DeviceClientManager.scheduleGatewayState(DeviceClientManager.java:473)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

using feign to request other resources and there are no any options on feign and http client

the java application could not access the SSL handshake and there has no server hello message respond from server, any help please?

I try to import the cipher suite [ bcprov-ext-jdk15on-1.70.jar, bcprov-jdk15on-1.70.jar ] into the $JAVA_HOME/jre/lib/ext/ and append the provider [ org.bouncycastle.jce.provider.BouncyCastleProvider ] to the java.security in $JAVA_HOME/jre/lib/security/java.security also. but it's not work.

keytool -import -alias "server-ssl" -keystore $JAVA_HOME/jre/lib/security/cacerts -file server.cer

Then I import the server certificate to the java truststore but it's not work yet.

It is ok to open the url on browser and can be accessed by curl or openssl -connect also. It seems only failed on the java application request host:port. I think that might be something wrong on configuring jdk ssl certificate or cipher suite.

How can I check that my server and client configurations are correct?


问:
Define Panel link on Grafana Template
I am defining panel link on Grafana message template but it is showing up as normal text
enter image description here

But I want something like this on the message.
enter image description here

This is my code: ``{{- define “slack.text” -}}
{{- range .Alerts -}}
{{ if gt (len .Annotations) 0 }}
Summary: {{.Annotations.summary}}
Description: {{.Annotations.description}}
Go to dashboard: {{.DashboardURL}}
{{ end }}
{{ end }}
`{{ end }}```

Can anybody please assist me on this.

Regards,
Zeeshan Khan

Title: Define Panel link on Grafana Template


问:
Anchor to same page tab wrong position vertical
I have a product page with two tabs (description and technical details): description can have long content and tech details is usually small.
Both tabs are fixed/sticy on scrolling, and anchored.
I would like the anchor to the second tab (technical details) to correctly position me to the top of the content but when I scroll the description and click on anchor, the link takes me to wrong vertical position.
How should I fix this in css?


问:
Problem in creating dynamic form fields in Django App using crispy form
I have one Model Given as below:-

```<code>class FeeItemAmount(models.Model):
    id = models.AutoField(primary_key=True)
    fee_item = models.ForeignKey(FeeItem, on_delete=models.CASCADE)
    class_obj = models.ForeignKey(Classes, on_delete=models.CASCADE)
    amount = models.IntegerField()

</code>```

For creating new item I wanted to populate the Classes objects from model and based on that we will show the  Form fields. One amount field for each class. In code I am doing that by:-

```<code>name = forms.CharField(label="Name", max_length=100)
months_list = forms.MultipleChoiceField(label='Months', widget=forms.CheckboxSelectMultiple,choices=months_name_list)
due_date = forms.IntegerField(label="Due Date",required=False)

def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    classes = Classes.objects.all()
    for class_obj in classes:
        field_name = 'class_%s' % (class_obj.id,)
        self.fields[field_name] = forms.IntegerField(label=class_obj.name,required=False)
    self.helper = FormHelper()
    self.helper.form_class = 'form-horizontal'
    self.helper.form_tag = False
    self.helper.label_class = 'col-sm-3'
    self.helper.field_class = 'col-sm-9'
    self.helper.layout = Layout(
        Div(
            Div('name', css_class='form-group col-sm-6 mb-0 border border-secondary'),
            Div('due_date', css_class='form-group col-sm-6 mb-0 border border-secondary'),
            css_class='form-row'),
        Div(
            Div(InlineCheckboxes('months_list'), css_class='form-group col-sm-12 mb-0 border border-secondary'),
            css_class='form-row'),
        Div(
            HTML("<p> Provide Amount for following Classes for this Fee Item:</p>"),
            css_class='form-row'),
    )

</code>```

Now the problem is that those dynamically created fields are not showing in the Form. If I remove the Layout part of the code than those fields are showing but than it is not in the format that i want.
I am new to Django and crispy form. I searched on google for this. One solution i found to use Slicing of the Layout by using :-

```<code>form.helper.all().wrap()
form.helper.wrap_together()

</code>```

But I am not knowing where to add this.

Please help me out of this. Is there any good documentation for creating Dynamic Form field.

Body:
I have one Model Given as below:-

class FeeItemAmount(models.Model):
    id = models.AutoField(primary_key=True)
    fee_item = models.ForeignKey(FeeItem, on_delete=models.CASCADE)
    class_obj = models.ForeignKey(Classes, on_delete=models.CASCADE)
    amount = models.IntegerField()

For creating new item I wanted to populate the Classes objects from model and based on that we will show the  Form fields. One amount field for each class. In code I am doing that by:-

name = forms.CharField(label="Name", max_length=100)
months_list = forms.MultipleChoiceField(label='Months', widget=forms.CheckboxSelectMultiple,choices=months_name_list)
due_date = forms.IntegerField(label="Due Date",required=False)

def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    classes = Classes.objects.all()
    for class_obj in classes:
        field_name = 'class_%s' % (class_obj.id,)
        self.fields[field_name] = forms.IntegerField(label=class_obj.name,required=False)
    self.helper = FormHelper()
    self.helper.form_class = 'form-horizontal'
    self.helper.form_tag = False
    self.helper.label_class = 'col-sm-3'
    self.helper.field_class = 'col-sm-9'
    self.helper.layout = Layout(
        Div(
            Div('name', css_class='form-group col-sm-6 mb-0 border border-secondary'),
            Div('due_date', css_class='form-group col-sm-6 mb-0 border border-secondary'),
            css_class='form-row'),
        Div(
            Div(InlineCheckboxes('months_list'), css_class='form-group col-sm-12 mb-0 border border-secondary'),
            css_class='form-row'),
        Div(
            HTML("
 Provide Amount for following Classes for this Fee Item:
"),
            css_class='form-row'),
    )

Now the problem is that those dynamically created fields are not showing in the Form. If I remove the Layout part of the code than those fields are showing but than it is not in the format that i want.
I am new to Django and crispy form. I searched on google for this. One solution i found to use Slicing of the Layout by using :-

form.helper.all().wrap()
form.helper.wrap_together()

But I am not knowing where to add this.

Please help me out of this. Is there any good documentation for creating Dynamic Form field.


问:
I can't communicate with the server on flutter 5g mobile lines
my application that I wrote with flutter does not communicate with the server on 5G mobile lines. No problem with 4G and wifi.

Are there any special permissions to use 5G with Flutter? I am using slim framework on server side.


问:
Get Recursive wget progression
In the context of a bash script recursivly downloading the content of a folder i would like to display the progress in the terminal. if i use the progress argument i get multiple progress line (1 for each file) but i would like a global one showing progress of the whole download

My actual code

wget -np -r -R "index.html*" "$url" -q
```

I look in the documentation for a built in feature but found nothing, i also think about making a simulation to count the expected number to be downloaded and catch each file download finish to update a progress bar but nothing too.

I am a bit stuck because the download take a long time and i can't let user in front of a simple "downloading" during half an hour, the is a risk he thnik that there is an issue.

Thanks for reading

Title: Get Recursive wget progression

Body:
In the context of a bash script recursivly downloading the content of a folder i would like to display the progress in the terminal. if i use the progress argument i get multiple progress line (1 for each file) but i would like a global one showing progress of the whole download

My actual code

wget -np -r -R "index.html*" "$url" -q

I look in the documentation for a built in feature but found nothing, i also think about making a simulation to count the expected number to be downloaded and catch each file download finish to update a progress bar but nothing too.

I am a bit stuck because the download take a long time and i can't let user in front of a simple "downloading" during half an hour, the is a risk he thnik that there is an issue.

Thanks for reading


问:
Center align and place items beneath one another in Angular Mat-Grid-Tile
I'm trying to make a login page using Angular Material. I have some code that is shown below:

```<code><mat-grid-list cols="2">
  <mat-grid-tile>
    <div>
      <h1 class="title">Welcome back!</h1>
      <span class="spanText">Please enter your details to get started</span>
    </div>
    <div>
      <form>
        <mat-form-field class="example-full-width">
          <mat-label>Email</mat-label>
          <input matInput placeholder="Enter your email" />
        </mat-form-field>
        <mat-form-field class="example-full-width">
          <mat-label>Password</mat-label>
          <input matInput placeholder="Enter your password" />
        </mat-form-field>
      </form>
    </div>
  </mat-grid-tile>

  <mat-grid-tile>Image Here</mat-grid-tile>
</mat-grid-list>
</code>```

And the CSS:

```<code>div {
  display: block;
  align-items: center;
  justify-content: center;
}

.title {
  font-size: 70px;
}

.spanText {
  color: rgb(102, 98, 100);
  font-size: 1rem;
}

.tileContent {
  justify-content: center;
  align-items: center;
}
</code>```

The problem that I have is that I am trying to:

Center align the items

Place the items below one another

However I cannot and any changes that I make seem to make no impact. How can I fix this and make sure that the items that are being placed including the h1 and span are center aligned. Currently, they're being placed one after another in a in-line style.

As of now, they are being shown like this:
https://imgur.com/a/mtGuOw6

Body:
I'm trying to make a login page using Angular Material. I have some code that is shown below:

<mat-grid-list cols="2">
  <mat-grid-tile>

Welcome back!

      Please enter your details to get started

      <form>
        <mat-form-field class="example-full-width">
          <mat-label>Email</mat-label>
          <input matInput placeholder="Enter your email" />
        </mat-form-field>
        <mat-form-field class="example-full-width">
          <mat-label>Password</mat-label>
          <input matInput placeholder="Enter your password" />
        </mat-form-field>
      </form>

  </mat-grid-tile>

  <mat-grid-tile>Image Here</mat-grid-tile>
</mat-grid-list>

And the CSS:

div {
  display: block;
  align-items: center;
  justify-content: center;
}

.title {
  font-size: 70px;
}

.spanText {
  color: rgb(102, 98, 100);
  font-size: 1rem;
}

.tileContent {
  justify-content: center;
  align-items: center;
}

The problem that I have is that I am trying to:

Center align the items

Place the items below one another

However I cannot and any changes that I make seem to make no impact. How can I fix this and make sure that the items that are being placed including the h1 and span are center aligned. Currently, they're being placed one after another in a in-line style.

As of now, they are being shown like this:
https://imgur.com/a/mtGuOw6


问:
Pyscript run all code blocks on one click
I want to run all code blocks on one click. Pyscript does have a run button on all of the <py-repl /> but I want to run all of blocks on single click and show output as one.

Further I want to add new <py-repl /> on click. Right now library adds new block when previous block's run button clicked.

Pyscript has no support for react right now, I am using DangerouslySetInnerHTML to add tags.


问:
Can I use pretty-errors with gunicorn
I work on a project where in development I run a django webapp in gunicorn on docker.
I want to use pretty-errors or any other tool that gives me pretty stacktrace. I have installed it and it works in the docker container because I can use it when I start a python shell. However when I start gunicorn instead of python, the stacktrace doest use pretty-errors. So does gunicorn interfere with pretty-errors?</p>

Title: Can I use pretty-errors with gunicorn


问:
Nuxt 2 + Typescript: Property '...' does not exist on type '{}'.ts(2339)
I added typescript to my existing nuxt@2.15.8 application following instructions from official docs (typescript, Composition API) and from some other blogs when official docs resulted in the error.

I checked these questions, nothing helped:
link1, link2 (Vue.extend() didn't work either)

Neither of $fetchState/fetchState syntaxes work as well.

Here's the code of the component:

<template>

    <Spinner v-if="$fetchState.pending" />

An error occurred

      {{ exam.results }}

</template>

```
<p>Here's my <code>tsconfig.json</code>:</p>
<pre class="lang-json prettyprint-override"><code>{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "ES2018",
    "module": "ESNext",
    "moduleResolution": "Node",
    "lib": ["ESNext", "ESNext.AsyncIterable", "DOM"],
    "esModuleInterop": true,
    "allowJs": true,
    "sourceMap": true,
    "strict": true,
    "noEmit": true,
    "paths": {
      "~/*": ["./*"],
      "@/*": ["./*"],
      "~~/*": ["./*"],
      "@@/*": ["./*"]
    },
    "types": ["@types/node", "@nuxt/types"]
  },
  "include": ["./**/*"],
  "exclude": ["node_modules", ".nuxt", "dist"],
  "vueCompilerOptions": {
    "target": 2
  }
}
</code>```

Here's my types/vue-shim.d.ts:

declare module '*.vue' {
  import Vue from 'vue'
  export default Vue
}
```
<p>Here's my <code>package.json</code>:</p>
<pre class="lang-json prettyprint-override"><code>{
  "name": "...",
  "version": "1.0.0",
  "scripts": {
    "dev": "nuxt --hostname 0.0.0.0 --port 3080",
    "build": "nuxt build",
    "start": "nuxt start --hostname 0.0.0.0 --port 3080",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore .",
    "lint": "yarn lint:js",
    "format": "prettier --write ."
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.12.5",
    "@nuxtjs/composition-api": "^0.33.1",
    "@nuxtjs/dotenv": "^1.4.1",
    "@nuxtjs/i18n": "^7.2.0",
    "@nuxtjs/pwa": "^3.3.5",
    "@tinymce/tinymce-vue": "3",
    "cookie-universal-nuxt": "^2.1.4",
    "core-js": "^3.8.3",
    "nuxt": "2.15.8",
    "nuxt-trailingslash-module": "^1.1.0",
    "nuxt-webfontloader": "^1.1.0"
  },
  "devDependencies": {
    "@nuxt/types": "^2.15.8",
    "@nuxt/typescript-build": "^2.1.0",
    "@nuxtjs/eslint-config-typescript": "^12.0.0",
    "@nuxtjs/eslint-module": "^3.1.0",
    "@vue/compiler-dom": "^3.2.40",
    "eslint": "^8.21.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-vue": "^9.3.0",
    "prettier": "latest"
  }
}
</code>```

Here's my buildModules in nuxt.config.js:

  buildModules: [
    '@nuxtjs/eslint-module',
    '@nuxtjs/dotenv',
    '@nuxt/typescript-build', // I tried disabling this, no difference
    '@nuxtjs/composition-api',
    // '@nuxtjs/composition-api/module', // This instead of the above line doesn't help either
  ],
```
<p>I honestly tried a lot of other small things that I don't remember, they got me closer but this error still shows up. Also I tried to reload VSCode's window and VSCode is updated to the latest version ;)</p>
<p>I feel like something is wrong with the <code>ref</code> object imported from <code>@nuxtjs/composition-api</code>, because when I hover over it, it just shows this:</p>
<p><img src="https://i.stack.imgur.com/zafY1.png" alt="hover on ref" /></p>
<p>And refs created in the setup function don't implicitly get the types from the values that were put into ref's argument like <code>const myRef = ref("text")</code> where <code>myRef</code> should be a ref of string but it's just <code>any</code>.</p>
<p>And when I hover on other things it's normal:
<img src="https://i.stack.imgur.com/tnP1H.png" alt="Other imports" /></p>
<p>When I start the project in development mode the terminal throws me an error/warning that says:</p>
```ERROR [Vue warn]: Property or method "exam" is not defined on the instance but referenced during render. Make sure that this property is
reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
```

But the server doesn't stop because of that. The component doesn't show the contents of exam obviously though.

Body:
I added typescript to my existing nuxt@2.15.8 application following instructions from official docs (typescript, Composition API) and from some other blogs when official docs resulted in the error.

I checked these questions, nothing helped:
link1, link2 (Vue.extend() didn't work either)

Neither of $fetchState/fetchState syntaxes work as well.

Here's the code of the component:

<template>

    <Spinner v-if="$fetchState.pending" />

An error occurred

      {{ exam.results }}

</template>

Here's my tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "ES2018",
    "module": "ESNext",
    "moduleResolution": "Node",
    "lib": ["ESNext", "ESNext.AsyncIterable", "DOM"],
    "esModuleInterop": true,
    "allowJs": true,
    "sourceMap": true,
    "strict": true,
    "noEmit": true,
    "paths": {
      "~/*": ["./*"],
      "@/*": ["./*"],
      "~~/*": ["./*"],
      "@@/*": ["./*"]
    },
    "types": ["@types/node", "@nuxt/types"]
  },
  "include": ["./**/*"],
  "exclude": ["node_modules", ".nuxt", "dist"],
  "vueCompilerOptions": {
    "target": 2
  }
}

Here's my types/vue-shim.d.ts:

declare module '*.vue' {
  import Vue from 'vue'
  export default Vue
}

Here's my package.json:

{
  "name": "...",
  "version": "1.0.0",
  "scripts": {
    "dev": "nuxt --hostname 0.0.0.0 --port 3080",
    "build": "nuxt build",
    "start": "nuxt start --hostname 0.0.0.0 --port 3080",
    "generate": "nuxt generate",
    "lint:js": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore .",
    "lint": "yarn lint:js",
    "format": "prettier --write ."
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.12.5",
    "@nuxtjs/composition-api": "^0.33.1",
    "@nuxtjs/dotenv": "^1.4.1",
    "@nuxtjs/i18n": "^7.2.0",
    "@nuxtjs/pwa": "^3.3.5",
    "@tinymce/tinymce-vue": "3",
    "cookie-universal-nuxt": "^2.1.4",
    "core-js": "^3.8.3",
    "nuxt": "2.15.8",
    "nuxt-trailingslash-module": "^1.1.0",
    "nuxt-webfontloader": "^1.1.0"
  },
  "devDependencies": {
    "@nuxt/types": "^2.15.8",
    "@nuxt/typescript-build": "^2.1.0",
    "@nuxtjs/eslint-config-typescript": "^12.0.0",
    "@nuxtjs/eslint-module": "^3.1.0",
    "@vue/compiler-dom": "^3.2.40",
    "eslint": "^8.21.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-vue": "^9.3.0",
    "prettier": "latest"
  }
}

Here's my buildModules in nuxt.config.js:

  buildModules: [
    '@nuxtjs/eslint-module',
    '@nuxtjs/dotenv',
    '@nuxt/typescript-build', // I tried disabling this, no difference
    '@nuxtjs/composition-api',
    // '@nuxtjs/composition-api/module', // This instead of the above line doesn't help either
  ],

I honestly tried a lot of other small things that I don't remember, they got me closer but this error still shows up. Also I tried to reload VSCode's window and VSCode is updated to the latest version ;)

I feel like something is wrong with the ref object imported from @nuxtjs/composition-api, because when I hover over it, it just shows this:

And refs created in the setup function don't implicitly get the types from the values that were put into ref's argument like const myRef = ref("text") where myRef should be a ref of string but it's just any.

And when I hover on other things it's normal:

When I start the project in development mode the terminal throws me an error/warning that says:

ERROR [Vue warn]: Property or method "exam" is not defined on the instance but referenced during render. Make sure that this property is
reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

But the server doesn't stop because of that. The component doesn't show the contents of exam obviously though.


问:
Failing to install the dependencies via yarn when deploying a subgraph
When I try to initialise the subgraph in my application folder , the process fails when yarn is installing the dependencies . It throws the following error.

```<code> Error: connect ETIMEDOUT 2405:200:1607:2820:41::36:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
</code>```

Attaching the commands i did  on the console>

I have tried updating graph cli, nodejs , yarn and also tried installing the dependencies manually but nothing seems to work.

Body:
When I try to initialise the subgraph in my application folder , the process fails when yarn is installing the dependencies . It throws the following error.

 Error: connect ETIMEDOUT 2405:200:1607:2820:41::36:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)

Attaching the commands i did  on the console>

I have tried updating graph cli, nodejs , yarn and also tried installing the dependencies manually but nothing seems to work.


问:
How do I generate a model scaffold in golang-revel?
I read the documentation and spent 2-3 hours playing around with revel.

However I wasnt able to generate a model controller view similar to the booking example in https://github.com/revel/examples, which is awesome but hard to reproduce from scratch.

Is there a Revel CLI command line to do something like this?

```<code>rails generate scaffold Album title:string year:decimal singer:reference
</code>```

Body:
I read the documentation and spent 2-3 hours playing around with revel.

However I wasnt able to generate a model controller view similar to the booking example in https://github.com/revel/examples, which is awesome but hard to reproduce from scratch.

Is there a Revel CLI command line to do something like this?

rails generate scaffold Album title:string year:decimal singer:reference


问:
Apply Drupal Patch using composer.json file
How to apply a patch for Drupal modules files through a composer.json file?

Basically, I have installed slick module and customised code and created a patch file using "git diff" command.  Slick module file path is modules/contrib/slick/ directory. Below is the code that i have written in the composser.json file.

```<code>"require": {
        "drupal/slick": "^2.7",
}

----------------------------------

"patches": {
  "drupal/slick": {
  "Slick custom changes": "patches/slick/slick.patch"
},
</code>```

But when running composer install, it just removes this slick package from "modules/contrib/slick, but does not reinstall or add the patch.

If i remove "Slick custom changes": "patches/slick/slick.patch" from composer.json and execute composer install cmd then it install slick module.

How to avoid removing this package and applying the patch?

Body:
How to apply a patch for Drupal modules files through a composer.json file?

Basically, I have installed slick module and customised code and created a patch file using "git diff" command.  Slick module file path is modules/contrib/slick/ directory. Below is the code that i have written in the composser.json file.

"require": {
        "drupal/slick": "^2.7",
}

----------------------------------

"patches": {
  "drupal/slick": {
  "Slick custom changes": "patches/slick/slick.patch"
},

But when running composer install, it just removes this slick package from "modules/contrib/slick, but does not reinstall or add the patch.

If i remove "Slick custom changes": "patches/slick/slick.patch" from composer.json and execute composer install cmd then it install slick module.

How to avoid removing this package and applying the patch?


问:
My react-navigation fullscreeen modal does not cover the tabs navigation on android
I'm currently struggeling with a behavior on react-navigation for react-native. My Navigation has a  bottom tab navigator which has four entries represented as Stacks.

```<code>const Tabs = createBottomTabNavigator<AppParamList>();

export const AppTabs: React.FC<AppTabsProps> = () => {
  return (
    <Tabs.Navigator>
      <Tabs.Screen
        name="Store"
        options={{
          title: i18n.t("STORE.STORE"),
          header: () => null,
        }}
        component={StoreStack}
      />
      <Tabs.Screen
        name="Favorites"
        options={{ title: i18n.t("FAVORITES"), header: () => null }}
        component={FavoriteStack}
      />
      <Tabs.Screen
        name="Orders"
        options={{ title: i18n.t("ORDERS"), header: () => null }}
        component={OrdersStack}
      />
      <Tabs.Screen
        name="Account"
        options={{ title: i18n.t("ACCOUNT"), header: () => null }}
        component={AccountStack}
      />
    </Tabs.Navigator>
  );
};

</code>```

One of those Stacks, the first one, includes a Stack which is represented as a fullscreen modal ( The last one called checkout).

```<code>const Stack = createNativeStackNavigator<StoreParamList>();

export const StoreStack: React.FC<StoreStackProps> = () => {
  return (
    <Stack.Navigator initialRouteName="Home">
      <Stack.Screen
        options={{ header: () => null }}
        name="Home"
        component={HomeScreen}
      />
      <Stack.Screen
        options={{ header: () => null }}
        name="Product"
        component={ProductScreen}
      />
      <Stack.Screen
        options={{ header: () => null, presentation: "fullScreenModal" }}
        name="Checkout"
        component={CheckoutStack}
      />
    </Stack.Navigator>
  );
};

</code>```

Now this does work as intended on ios, where its just opening a fullscreen modal only showing my checkout stack. My problem is, that, since the modal stack is contained within my TabsNavigator, on android it opens the modal while still presenting the TabNavigator on the bottom. Does anyone have a advice on how I can go around this problem?

There is a flag on the tabsNavigator, where you can remove the tabBar

```<code>options={{
   tabBarStyle: { display: "none" },
}}
</code>```

, however that is only on the upper level and is not available within my Tabs.Screens. I was thinking of moving up the modal to that level, but then it displays a fifth entry in my tabsBar and also complicates the navigation with Typescript.

Body:
I'm currently struggeling with a behavior on react-navigation for react-native. My Navigation has a  bottom tab navigator which has four entries represented as Stacks.

const Tabs = createBottomTabNavigator<AppParamList>();

export const AppTabs: React.FC<AppTabsProps> = () => {
  return (
    <Tabs.Navigator>
      <Tabs.Screen
        name="Store"
        options={{
          title: i18n.t("STORE.STORE"),
          header: () => null,
        }}
        component={StoreStack}
      />
      <Tabs.Screen
        name="Favorites"
        options={{ title: i18n.t("FAVORITES"), header: () => null }}
        component={FavoriteStack}
      />
      <Tabs.Screen
        name="Orders"
        options={{ title: i18n.t("ORDERS"), header: () => null }}
        component={OrdersStack}
      />
      <Tabs.Screen
        name="Account"
        options={{ title: i18n.t("ACCOUNT"), header: () => null }}
        component={AccountStack}
      />
    </Tabs.Navigator>
  );
};

One of those Stacks, the first one, includes a Stack which is represented as a fullscreen modal ( The last one called checkout).

const Stack = createNativeStackNavigator<StoreParamList>();

export const StoreStack: React.FC<StoreStackProps> = () => {
  return (
    <Stack.Navigator initialRouteName="Home">
      <Stack.Screen
        options={{ header: () => null }}
        name="Home"
        component={HomeScreen}
      />
      <Stack.Screen
        options={{ header: () => null }}
        name="Product"
        component={ProductScreen}
      />
      <Stack.Screen
        options={{ header: () => null, presentation: "fullScreenModal" }}
        name="Checkout"
        component={CheckoutStack}
      />
    </Stack.Navigator>
  );
};

Now this does work as intended on ios, where its just opening a fullscreen modal only showing my checkout stack. My problem is, that, since the modal stack is contained within my TabsNavigator, on android it opens the modal while still presenting the TabNavigator on the bottom. Does anyone have a advice on how I can go around this problem?

There is a flag on the tabsNavigator, where you can remove the tabBar

options={{
   tabBarStyle: { display: "none" },
}}

, however that is only on the upper level and is not available within my Tabs.Screens. I was thinking of moving up the modal to that level, but then it displays a fifth entry in my tabsBar and also complicates the navigation with Typescript.


问:
Funky behavior when using different integer sizes
I am just doing my first steps with Fortran, and the initial joy of having 128-bit integers has vanished...

```<code>program multiples_of_3_and_5

    implicit none

    ! n is the number to test whether it is divisible by 3 or 5
    !
    ! kind = 8 defines a 64-bit integer (8 bytes = 64 bits)
    integer(kind=8) :: n

    ! n stores the sum of all n which are divisible by either 3 or 5
    integer(kind=8) :: s

    do n = 1, 1000-1
        print *, "n = ", n
        if (mod(n, 3) == 0 .or. mod(n, 5) == 0) then

            print *, "n is divisible by either 3 or 5"
            s = s + n

        end if
        print *, "s = ", s
    end do

    print *,"The result is: ", s

end program multiples_of_3_and_5
</code>```

When I use kind=4 or 16 or 32, it doesn't give the correct result anymore - even when no integer overflow occurs.

Edit: Example output (with kind=16)

```<code> n is divisible by either 3 or 5
 s =   -23552265132012064450548819805997922555
 n =                                       996
 n is divisible by either 3 or 5
 s =   -23552265132012064450548819805997921559
 n =                                       997
 s =   -23552265132012064450548819805997921559
 n =                                       998
 s =   -23552265132012064450548819805997921559
 n =                                       999
 n is divisible by either 3 or 5
 s =   -23552265132012064450548819805997920560
 The result is:   -23552265132012064450548819805997920560
</code>```

Body:
I am just doing my first steps with Fortran, and the initial joy of having 128-bit integers has vanished...

program multiples_of_3_and_5

    implicit none

    ! n is the number to test whether it is divisible by 3 or 5
    !
    ! kind = 8 defines a 64-bit integer (8 bytes = 64 bits)
    integer(kind=8) :: n

    ! n stores the sum of all n which are divisible by either 3 or 5
    integer(kind=8) :: s

    do n = 1, 1000-1
        print *, "n = ", n
        if (mod(n, 3) == 0 .or. mod(n, 5) == 0) then

            print *, "n is divisible by either 3 or 5"
            s = s + n

        end if
        print *, "s = ", s
    end do

    print *,"The result is: ", s

end program multiples_of_3_and_5

When I use kind=4 or 16 or 32, it doesn't give the correct result anymore - even when no integer overflow occurs.

Edit: Example output (with kind=16)

 n is divisible by either 3 or 5
 s =   -23552265132012064450548819805997922555
 n =                                       996
 n is divisible by either 3 or 5
 s =   -23552265132012064450548819805997921559
 n =                                       997
 s =   -23552265132012064450548819805997921559
 n =                                       998
 s =   -23552265132012064450548819805997921559
 n =                                       999
 n is divisible by either 3 or 5
 s =   -23552265132012064450548819805997920560
 The result is:   -23552265132012064450548819805997920560


问:
Unresolved reference when building Kotlin source code
I'm trying to build project written in Kotlin that has classes with references to javax.smartcardio package. As build system Gradle is used. And when I try to build system just shows "Unresolved reference" message. java.smartcardio module is a part of JDK and I'm using as target JVM version 8 so I think there is no necessity in module-info.java files.

I googled a lot and have not found any solution for now. So would appreciate any advice.

Also I'm full time C# developer so Java, Kotlin is very new for me.

Link to source of project that I try to build:

https://github.com/tangem/tangem-sdk-android

Some screenshots:

This are the gradle dependencies:

```<code>dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
     implementation project(':tangem-sdk-core')
     implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
     implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.9"
     implementation "com.squareup.sqldelight:sqlite-driver:1.4.3"
}
</code>```

Body:
I'm trying to build project written in Kotlin that has classes with references to javax.smartcardio package. As build system Gradle is used. And when I try to build system just shows "Unresolved reference" message. java.smartcardio module is a part of JDK and I'm using as target JVM version 8 so I think there is no necessity in module-info.java files.

I googled a lot and have not found any solution for now. So would appreciate any advice.

Also I'm full time C# developer so Java, Kotlin is very new for me.

Link to source of project that I try to build:

https://github.com/tangem/tangem-sdk-android

Some screenshots:

This are the gradle dependencies:

dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"
     implementation project(':tangem-sdk-core')
     implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
     implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.9"
     implementation "com.squareup.sqldelight:sqlite-driver:1.4.3"
}


问:
How to hide code into brakets in Code Composer/Eclipse
How I can hide  code into brackets in Code Composer/Eclipse into my c++ project?

I press Ctrl + \ to show hide button near method. But how can I make it for all brackets.


问:
Is there a way to render html content in tooltip of icon/span in angular 7
Is there a way to render Html content in the tooltip of icon/span in angular 7


问:
Calling another form with WebBrowser from mainform - giving ERROR?
I'm calling from3 from my form1 and its giving this error in InitializeComponent()

```<code>Form3 frm = new Form3();
        frm.Show();
</code>```

Error "ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment."

from3 is having a WebBrowser control and my from1 is running a backgroundworker

thnx

ContentLicense: CC BY-SA 3.0

Body:
I'm calling from3 from my form1 and its giving this error in InitializeComponent()

Form3 frm = new Form3();
        frm.Show();

Error "ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment."

from3 is having a WebBrowser control and my from1 is running a backgroundworker

thnx


问:
Find how much changed the scale of a numpy array by use scipy.optimize or Scikit-learn
There is a initial function and inital values, Then in one diraction our data will be scaled with a unknown value but we can detect the y array.

How we can calculate x_unknown? by having x_known,y_known and y_detected

plot

Here is a example:

```<code>import numpy as np
import matplotlib.pyplot as plt

def Gauss(x, mu, sigma, intensity = 1):
    gaussian = intensity/(sigma * np.sqrt(2*np.pi)) * np.exp(-0.5*((x-mu)/sigma)**2)
    return gaussian

x_known=  np.linspace(300, 900, 1000)
y_known =  Gauss(x_known, 600, 80, 1)

x_unknown=np.linspace(100, 2000, 1000)
detected =  Gauss(x_unknown, 600, 80, 1)

# normalizing and add noise
y_known = (y_known/np.max(y_known))+np.random.normal(0, 0.02, len(x_known))
y_detected = (detected/np.max(detected))+np.random.normal(0, 0.02, len(x_unknown))

fig, (ax1, ax2) = plt.subplots(1, 2,figsize=(10, 5))
ax1.plot( x_known,y_known, color = 'black')
ax2.plot( x_unknown,y_detected, color = 'black')
ax2.axes.get_xaxis().set_visible(False)
ax1.title.set_text('Initail data')
ax2.title.set_text('Scaled data')

#x_unknown=??? How we can calculate x_unknown by having x_known,y_known and y_detected
</code>```

Body:
There is a initial function and inital values, Then in one diraction our data will be scaled with a unknown value but we can detect the y array.

How we can calculate x_unknown? by having x_known,y_known and y_detected

plot

Here is a example:

import numpy as np
import matplotlib.pyplot as plt

def Gauss(x, mu, sigma, intensity = 1):
    gaussian = intensity/(sigma * np.sqrt(2*np.pi)) * np.exp(-0.5*((x-mu)/sigma)**2)
    return gaussian

x_known=  np.linspace(300, 900, 1000)
y_known =  Gauss(x_known, 600, 80, 1)

x_unknown=np.linspace(100, 2000, 1000)
detected =  Gauss(x_unknown, 600, 80, 1)

# normalizing and add noise
y_known = (y_known/np.max(y_known))+np.random.normal(0, 0.02, len(x_known))
y_detected = (detected/np.max(detected))+np.random.normal(0, 0.02, len(x_unknown))

fig, (ax1, ax2) = plt.subplots(1, 2,figsize=(10, 5))
ax1.plot( x_known,y_known, color = 'black')
ax2.plot( x_unknown,y_detected, color = 'black')
ax2.axes.get_xaxis().set_visible(False)
ax1.title.set_text('Initail data')
ax2.title.set_text('Scaled data')

#x_unknown=??? How we can calculate x_unknown by having x_known,y_known and y_detected


问:
handle FileReader Api Errors and progress events
I try to read a file uploaded to my front-end app, and need to test fileReader for the case when an Error occurs. I detect errors by an onError event, and I want to emit an error event to test the view.
When the error occurs, I want to know if the progress event stopped or not.

I tried to dispatch the error event, the error event function runs, but the progress event did not stop.

How can I test the fileReader error condition in order to verify that when a fileReader error occurs that the progress event is actually stopped?

```<code>
let filereader= new FileReader();
filereader.readAsDataURL(file);

filereader.dispatchEvent(new Event('error'));

</code>```

Body:
I try to read a file uploaded to my front-end app, and need to test fileReader for the case when an Error occurs. I detect errors by an onError event, and I want to emit an error event to test the view.
When the error occurs, I want to know if the progress event stopped or not.

I tried to dispatch the error event, the error event function runs, but the progress event did not stop.

How can I test the fileReader error condition in order to verify that when a fileReader error occurs that the progress event is actually stopped?

let filereader= new FileReader();
filereader.readAsDataURL(file);

filereader.dispatchEvent(new Event('error'));


问:
After implementing the Redis cache in the C# application, test cases start failing in the Azure build pipeline
We have implemented Redis cache in the C# application on existing methods like GetMatserData. There is an existing test case that is working fine on the local system after Redis implementation. But on Azure Pipeline we are getting the below error:

StackExchange.Redis.RedisConnectionException : It was not possible to connect to the redis server(s). Error connecting right now. To allow this multiplexer to continue retrying until it's able to connect, use abortConnect=false in your connection string or AbortOnConnectFail=false; in your code.


问:
Should I upgrade version in Manifest on code change, MS office js?
When building MS Office add-ins with the office-js you can change the version of the app in the Manifest. But, as far as I can see the Manifest is just there to point to a website that has the information on how to run the add-in app. So, right now I am just pushing my changes to the website, and I never change the Manifest at all.

Do I need to upgrade the version number in the Manifest every time I push changes to the office add-in?

I am asking in general, but one reason I am wondering is that my users are experiencing cache issues, and issues with their security, that I am thinking might get resolved by upgrading the version every time - but then the user has to add the add-in from the store again every time, and it also gives me an extra step in my process.


问:
How to cluster similar unordered text in single column of dataframe in python?
I want to cluster similar sentences
Please help..

My dataset looks like this..

column

I like apples

Man is mortal

I apple like

East is direction

look apple I

mortal is man

direction est is

Expected output:

column        ** Cluster**

I like apples--------> 1

I apple like---------> 1

look apple I---------> 1

Man is mortal--------> 2

mortal is man--------> 2

East is direction----> 3

direction est is-----> 3

Note: Even though there are spelling mistakes still it should form in a same cluster


问:
UNUserNotificationCenter.current().removeAllDeliveredNotifications() not removing notification
I have class NotificationService which is inheriting UNNotificationServiceExtension.
didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) inside this function I am trying to remove notification after 8 second using UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifier). But it's not removing notification from tray, please help me here.


问:
Junit test cases for delete operation with try and catch block - handling Exception

public UserNoteDefination deleteByNoteCd (UserNoteDefination request, LogDTO log) {
log.setComponent("ClientRequestService.deleteByNoteCd");
UserNoteDefination response new UserNoteDefination();

String tabllame = request.getTabName();

String noteCd-request.getNoteCd();
if (tabName.equalsIgnoreCase("UND_TABLE"))

{

try

userNoteDefRepository.deleteById(noteCd);
response.setMsg("Completed");

log.setPayload("[FROM:UI] clientRequest:Delete Successfully");

loggingService.log(GuiServiceConstants.INFO LEVEL, log);

}

catch (Exception e){

response.setMsg("Error");

log.setPayload("[FROM:UI] clientRequest:Error occured while delete");

loggingService.log(GuiServiceConstants.ERROR LEVEL, log);

}

return response;
}
```
<p>This is my junit code in mockito</p>
<pre class="lang-java prettyprint-override"><code>@Test public void deleteByNoteCd() throws Exception {

LogDTO log = new LogDTO(); log.setComponent("ClientRequestService.getClientRequest");

UserNoteDefination response = new UserNoteDefination();

response.setNoteCd("TEST7");

response.setMsg("Completed");

response.setTabName("UND TABLE");

UserNoteDefination rval - service.deleteByNoteCd(response, log);

assertNotNull(rval);
}
</code>```

I'm unable to cover the exception part. Cab someone help

Body:
public UserNoteDefination deleteByNoteCd (UserNoteDefination request, LogDTO log) {
log.setComponent("ClientRequestService.deleteByNoteCd");
UserNoteDefination response new UserNoteDefination();

String tabllame = request.getTabName();

String noteCd-request.getNoteCd();
if (tabName.equalsIgnoreCase("UND_TABLE"))

{

try

userNoteDefRepository.deleteById(noteCd);
response.setMsg("Completed");

log.setPayload("[FROM:UI] clientRequest:Delete Successfully");

loggingService.log(GuiServiceConstants.INFO LEVEL, log);

}

catch (Exception e){

response.setMsg("Error");

log.setPayload("[FROM:UI] clientRequest:Error occured while delete");

loggingService.log(GuiServiceConstants.ERROR LEVEL, log);

}

return response;
}

This is my junit code in mockito

@Test public void deleteByNoteCd() throws Exception {

LogDTO log = new LogDTO(); log.setComponent("ClientRequestService.getClientRequest");

UserNoteDefination response = new UserNoteDefination();

response.setNoteCd("TEST7");

response.setMsg("Completed");

response.setTabName("UND TABLE");

UserNoteDefination rval - service.deleteByNoteCd(response, log);

assertNotNull(rval);
}

I'm unable to cover the exception part. Cab someone help


问:
Using JSF/Mojarra on IE7/IE8: Request is not applied
I have a quite complicated table website in which I want to browse with pages (e.g. 5 rows at a time). This browsing works great in Firefox, but does not in Internet Explorer (7 + 8).

I investigated the HTTP traffic and found out, that the response generated by the server is correct, but in IE the content is just not updated (also no error messages, e.g. in the console). I spent the whole day creating a sandbox example, but unfortunately all smaller examples work perfectly. I am now considering two things:

My response is too big for IE7/IE8 JS engine to handle.

The response contains some sequences not digestable by IE7/IE8 JS engine or Mojarra.

Are you aware of any such bugs in Mojarra / IE JS? I am using Mojarra 2.1.3.

The browsing is triggered by an ajax command link:

```<code><h:commandLink value=">" actionListener="#{cc.attrs.tblModel.nextPage}">
  <f:ajax execute=":#{cc.attrs.tblId}" render=":#{cc.attrs.tblId}" />
</h:commandLink>
</code>```

As I think the problem could be the exact response, here is an original response (stripped down the minimum that still doesn't work):

```<code><partial-response>
<changes>
    <update id="tableForm:resultsPanel:tableComponent"><![CDATA[<div id="tableForm:resultsPanel:tableComponent">
    <span class="table-total">Total Elemente
        <strong>58</strong>
    </span>
    <span class="table-pro-seite">Anzahl Elemente pro Seite Anzeigen:

        <span class="selected">5</span>
         |
        <a id="tableForm:resultsPanel:j_idt555:j_idt244" href="#" onclick="mojarra.ab(this,event,'action','tableForm:resultsPanel:tableComponent','tableForm:resultsPanel:tableComponent');return false">10</a>
         |
        <a id="tableForm:resultsPanel:j_idt555:j_idt250" href="#" onclick="mojarra.ab(this,event,'action','tableForm:resultsPanel:tableComponent','tableForm:resultsPanel:tableComponent');return false">20</a>

    </span>
    <div class="table-content">

    </div><div id="tableForm:resultsPanel:tableFooter:table-footer" class="table-footer">
<div id="tableFooter">
    <div class="table-paging"><a id="tableForm:resultsPanel:tableFooter:firstLink" href="#" onclick="mojarra.ab(this,event,'action','tableForm:resultsPanel:tableComponent','tableForm:resultsPanel:tableComponent');return false" class="table-paging-firstLink"><<</a><a id="tableForm:resultsPanel:tableFooter:previousLink" href="#" onclick="mojarra.ab(this,event,'action','tableForm:resultsPanel:tableComponent','tableForm:resultsPanel:tableComponent');return false" class="table-paging-previousLink"><</a>

            <span class="table-paging-currentpage">Seite<input id="tableForm:resultsPanel:tableFooter:currentPage" type="text" name="tableForm:resultsPanel:tableFooter:currentPage" value="2" class="table-input" onkeypress="return displayedPageKeypressEvent(event);" />von 12<input id="tableForm:resultsPanel:tableFooter:sendDisplayedPage" type="submit" name="tableForm:resultsPanel:tableFooter:sendDisplayedPage" value="send" style="visibility: hidden; float: right;" onclick="mojarra.ab(this,event,'action','@form','tableForm:resultsPanel:tableComponent');return false" />
            </span><span id="tableForm:resultsPanel:tableFooter:pageSelector"><a id="tableForm:resultsPanel:tableFooter:nextLink" href="#" onclick="mojarra.ab(this,event,'action','tableForm:resultsPanel:tableComponent','tableForm:resultsPanel:tableComponent');return false" class="table-paging-nextLink">></a><a id="tableForm:resultsPanel:tableFooter:lastLink" href="#" onclick="mojarra.ab(this,event,'action','tableForm:resultsPanel:tableComponent','tableForm:resultsPanel:tableComponent');return false" class="table-paging-lastLink">>></a></span></div><span id="tableForm:resultsPanel:tableFooter:table-footer-multiselect"></span>
    </div></div></div>]]></update>
    <extension primefacesCallbackParam="validationFailed">{"validationFailed":false}</extension>
</changes>
</partial-response>
</code>```

Thank you very much for any help!

PS: I am also using Primefaces, but I guess this has nothing to do with the problem.

Body:
I have a quite complicated table website in which I want to browse with pages (e.g. 5 rows at a time). This browsing works great in Firefox, but does not in Internet Explorer (7 + 8).

I investigated the HTTP traffic and found out, that the response generated by the server is correct, but in IE the content is just not updated (also no error messages, e.g. in the console). I spent the whole day creating a sandbox example, but unfortunately all smaller examples work perfectly. I am now considering two things:

My response is too big for IE7/IE8 JS engine to handle.

The response contains some sequences not digestable by IE7/IE8 JS engine or Mojarra.

Are you aware of any such bugs in Mojarra / IE JS? I am using Mojarra 2.1.3.

The browsing is triggered by an ajax command link:

<h:commandLink value=">" actionListener="#{cc.attrs.tblModel.nextPage}">
  <f:ajax execute=":#{cc.attrs.tblId}" render=":#{cc.attrs.tblId}" />
</h:commandLink>

As I think the problem could be the exact response, here is an original response (stripped down the minimum that still doesn't work):

<partial-response>
<changes>
    <update id="tableForm:resultsPanel:tableComponent"><![CDATA[

    Total Elemente
        58

    Anzahl Elemente pro Seite Anzeigen:

        5
         |
        10
         |
        20

<<<

            Seite<input id="tableForm:resultsPanel:tableFooter:currentPage" type="text" name="tableForm:resultsPanel:tableFooter:currentPage" value="2" class="table-input" onkeypress="return displayedPageKeypressEvent(event);" />von 12<input id="tableForm:resultsPanel:tableFooter:sendDisplayedPage" type="submit" name="tableForm:resultsPanel:tableFooter:sendDisplayedPage" value="send" style="visibility: hidden; float: right;" onclick="mojarra.ab(this,event,'action','@form','tableForm:resultsPanel:tableComponent');return false" />
            >>>

]]></update>
    <extension primefacesCallbackParam="validationFailed">{"validationFailed":false}</extension>
</changes>
</partial-response>

Thank you very much for any help!

PS: I am also using Primefaces, but I guess this has nothing to do with the problem.


问:
Webpack Dev Server - hot reload on another local server
We have a React app that's embedded and served in .NET CMS project.
App is bootstrapped with Create React App and webpack config tweaked with craco.

Webpack dev server is running at default location http://localhost:3000 and CMS is running at https://localhost:5000

When I open https://localhost:5000, I correctly see React app. However, console is full of errors

WebSocket connection to 'wss://localhost:3000/ws' failed:

Is there a way to configure it to work with hot reload from external server?

I have tried setting dev server to https and adjusting webSocketURL, but did the error persists.