问:
Solving a non-linear equation using fsolve
I have this non-linear equation:
Ax + Bxy - C = 0 where A, B and C are all constants. I have a bunch of different values for A, B and C, like about 10000.

My questions is how can i use the different set of A, B and C values I have to generate the perfect solution to the system of non-linear equations, what starting point to use and also how to plot them in matplotlib finally. Thanks for your help!.

I tried to use fsolve like this.
Note: The coeffs is a dataframe which stored the values for A and B and merged_sensoren is another dataframe which stores the value for C in the first column.

Here are a snippet of the dataframe coeffs:

```<code>coeffs = {'coeffX0': [0, 0, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3], 'coeffX1': [0, 0, 0, 58, 60, 58, 60, 87, 90, 87, 90, 87, 90, 87, 90]}
</code>```

Some values of the coeffecient C are = [0, 0, 0, 0, 0, 4, 4, 0, 0, 1, 1, 15, 15]

```<code>from scipy.optimize import fsolve

def f(x):
    return [coeffs.iloc[10,0] * x[0] + coeffs.iloc[10,1] * x[0] * x[1] - merged_sensoren.iloc[10,0],
            coeffs.iloc[11,0] * x[0] + coeffs.iloc[11,1] * x[0] * x[1] - merged_sensoren.iloc[11,0]]

root = fsolve(f, [1, 1])
root
</code>```

This gave me the answer as

```<code>array([1., 1.])
</code>```

Can someone explain what does 1., 1. mean for a solution. Is this even a number?

however, root = fsolve(f, [0, 0]) gave me array([ 1.40333333e+02, -3.32541568e-02]).

Body:
I have this non-linear equation:
Ax + Bxy - C = 0 where A, B and C are all constants. I have a bunch of different values for A, B and C, like about 10000.

My questions is how can i use the different set of A, B and C values I have to generate the perfect solution to the system of non-linear equations, what starting point to use and also how to plot them in matplotlib finally. Thanks for your help!.

I tried to use fsolve like this.
Note: The coeffs is a dataframe which stored the values for A and B and merged_sensoren is another dataframe which stores the value for C in the first column.

Here are a snippet of the dataframe coeffs:

coeffs = {'coeffX0': [0, 0, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3], 'coeffX1': [0, 0, 0, 58, 60, 58, 60, 87, 90, 87, 90, 87, 90, 87, 90]}

Some values of the coeffecient C are = [0, 0, 0, 0, 0, 4, 4, 0, 0, 1, 1, 15, 15]

from scipy.optimize import fsolve

def f(x):
    return [coeffs.iloc[10,0] * x[0] + coeffs.iloc[10,1] * x[0] * x[1] - merged_sensoren.iloc[10,0],
            coeffs.iloc[11,0] * x[0] + coeffs.iloc[11,1] * x[0] * x[1] - merged_sensoren.iloc[11,0]]

root = fsolve(f, [1, 1])
root

This gave me the answer as

array([1., 1.])

Can someone explain what does 1., 1. mean for a solution. Is this even a number?

however, root = fsolve(f, [0, 0]) gave me array([ 1.40333333e+02, -3.32541568e-02]).


来源: stackexchange

问:
jQuery: window on load not triggered?
I saved a webpage offline, in the HTML code, in the bottom (before the  tags I inserted:

The page has Jquery loaded, and indeed I got the version alerted, but nothing from the window.onload event?

```<code><script type="text/javascript">
    if (typeof jQuery != 'undefined') {
        // if jQuery is loaded, print the version
        alert(jQuery.fn.jquery); // outputs 3.6.1
        $(window).on("load", function(e) {
            alert("window loaded from jQuery, now scroll");
            $("html, body").animate({ scrollTop: $(document).height() }, 1000);
        })
    }
</script>
</code>```

ContentLicense: CC BY-SA 4.0

Title: jQuery: window on load not triggered?


问:
Click Day on FullCalendar with jQuery
I want to click day on FullCalendar.io with jQuery or JavaScript but it's not clicking.

```<code><td class="fc-daygrid-day fc-day fc-day-mon fc-day-future date-availiable" data-date="2023-01-09" tabindex="0">
  <div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner">
    <div class="fc-daygrid-day-top"><a class="fc-daygrid-day-number">9 <span class="sr-only"> January 2023</span></a></div>
    <div class="fc-daygrid-day-events">
      <div class="fc-daygrid-event-harness" style="margin-top: 0px;">
        <a class="fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-start fc-event-end fc-event-future availiable">
          <div class="fc-event-main">
            <div class="fc-event-main-frame">
              <div class="fc-event-title-container">
                <div class="fc-event-title fc-sticky">availiable</div>
              </div>
            </div>
          </div>
        </a>
      </div>
      <div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div>
    </div>
    <div class="fc-daygrid-day-bg"></div>
  </div>
</td>
</code>```
```<code>$('.fc-scrollgrid-sync-table tbody tr').find('td').each (function() {
            if($(this).hasClass("date-availiable")){
                    $(this).find('a.fc-daygrid-day-number').trigger('click');
                    return false;
            }
        });
</code>```

I tried this code but it's not work.

Title: Click Day on FullCalendar with jQuery

Body:
I want to click day on FullCalendar.io with jQuery or JavaScript but it's not clicking.

9  January 2023

availiable

$('.fc-scrollgrid-sync-table tbody tr').find('td').each (function() {
            if($(this).hasClass("date-availiable")){
                    $(this).find('a.fc-daygrid-day-number').trigger('click');
                    return false;
            }
        });

I tried this code but it's not work.


问:
Randomize Buttons' coordinates without making them obscure each other
I'm making an app with a few games, one of which is memory game that is supposed to randomize buttons' placement and numbers, hide the numbers, and make the player memorize the order of them. I'm struggling to randomize their position in a way to prevent them from appearing one above another.

I tried to make an Array out of screen width and height, pick random numbers from them as coordinates for the button, and then remove numbers between the picked one and picked one + button width/height accordingly, but it doesn't work quite right. What would be the correct approach?

enter image description here


问:
Is there any way to speed up the download of images from my API?
This is a beginners question. I have an API that is supposed to return a list of "MyContent". When I call the API from my test device it takes too long to load the byte array. It takes around 7 seconds on my iphone and 5 on the MVC app that I use for testing. I know that it is the byte array that is slowing everything down.

Below is my code. Is there anything I can do to my code that will speed things up? Other applications on my test device loads super fast so it should not be the bandwidth?

```<code>    public class MyContent
    {
       public byte[] Content;
       public string Name;
    }

    [Route("/GetPicturesFromBlobStorage")]
    [HttpPost]
    [AllowAnonymous]
    public async Task<IActionResult> GetPicturesFromBlobStorageAsync([FromBody] List<string> filenames)
    {
        var files = new List<MyContent>();

        // here I have a loop that fills the "files" property.

        var str = JsonConvert.SerializeObject(files);

        return Ok(str);

    }
</code>```

This is the Xamarin.iOS code:

```<code>        var responseIng = await client.PostAsJsonAsync(url, files); // THIS IS THE LINE THAT TAKES FOREVER.

        String urlContentsIng = await responseIng.Content.ReadAsStringAsync();
</code>```

UPDATE:

I changed so that I do not use json:

```<code> public async Task<FileContentResult> GetPicturesFromBlobStorageAsync([FromForm] string filename)
    {
        var stopWatch5 = Stopwatch.StartNew();

        AzureStorageConfig config = new AzureStorageConfig();
        config.AccountName = "xxx";
        config.AccountKey = "xx"
        config.stagecontainer = "xx";

        var sasToken =
           _azureStorageBlobOptionsTokenGenerator.GenerateSasToken(
           config.stagecontainer);

        var storageCredentials =
                new StorageCredentials(
                    sasToken);

        var cloudStorageAccount =
            new CloudStorageAccount(storageCredentials, config.AccountName, null, true);

        var cloudBlobClient =
            cloudStorageAccount.CreateCloudBlobClient();

        var cloudBlobContainer =
        cloudBlobClient.GetContainerReference(config.stagecontainer);

        var blobName = filename;

        var cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);

        var stream = new MemoryStream();

        await cloudBlockBlob.DownloadToStreamAsync(stream);
        byte[] bytes = stream.ToArray();
        var time = stopWatch5.Elapsed.TotalSeconds;

        return File(bytes, "image/jpeg", filename);

    }
</code>```

And this is my client call to the API

```<code>            var bag = new System.Collections.Concurrent.ConcurrentBag<object>();
        var tasks = files.Select(async file =>
        {
            var multiFormCat = new MultipartFormDataContent();
            multiFormCat.Add(new StringContent(file), "filename");
            var responseIng = await client.PostAsync(url, multiFormCat);

            var content = await responseIng.Content.ReadAsByteArrayAsync();
        });
        await Task.WhenAll(tasks);
</code>```

It still takes around 4-5 seconds. Is there anything more I can do to improve performance?

Body:
This is a beginners question. I have an API that is supposed to return a list of "MyContent". When I call the API from my test device it takes too long to load the byte array. It takes around 7 seconds on my iphone and 5 on the MVC app that I use for testing. I know that it is the byte array that is slowing everything down.

Below is my code. Is there anything I can do to my code that will speed things up? Other applications on my test device loads super fast so it should not be the bandwidth?

    public class MyContent
    {
       public byte[] Content;
       public string Name;
    }

    [Route("/GetPicturesFromBlobStorage")]
    [HttpPost]
    [AllowAnonymous]
    public async Task<IActionResult> GetPicturesFromBlobStorageAsync([FromBody] List<string> filenames)
    {
        var files = new List<MyContent>();

        // here I have a loop that fills the "files" property.

        var str = JsonConvert.SerializeObject(files);

        return Ok(str);

    }

This is the Xamarin.iOS code:

        var responseIng = await client.PostAsJsonAsync(url, files); // THIS IS THE LINE THAT TAKES FOREVER.

        String urlContentsIng = await responseIng.Content.ReadAsStringAsync();

UPDATE:

I changed so that I do not use json:

 public async Task<FileContentResult> GetPicturesFromBlobStorageAsync([FromForm] string filename)
    {
        var stopWatch5 = Stopwatch.StartNew();

        AzureStorageConfig config = new AzureStorageConfig();
        config.AccountName = "xxx";
        config.AccountKey = "xx"
        config.stagecontainer = "xx";

        var sasToken =
           _azureStorageBlobOptionsTokenGenerator.GenerateSasToken(
           config.stagecontainer);

        var storageCredentials =
                new StorageCredentials(
                    sasToken);

        var cloudStorageAccount =
            new CloudStorageAccount(storageCredentials, config.AccountName, null, true);

        var cloudBlobClient =
            cloudStorageAccount.CreateCloudBlobClient();

        var cloudBlobContainer =
        cloudBlobClient.GetContainerReference(config.stagecontainer);

        var blobName = filename;

        var cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);

        var stream = new MemoryStream();

        await cloudBlockBlob.DownloadToStreamAsync(stream);
        byte[] bytes = stream.ToArray();
        var time = stopWatch5.Elapsed.TotalSeconds;

        return File(bytes, "image/jpeg", filename);

    }

And this is my client call to the API

            var bag = new System.Collections.Concurrent.ConcurrentBag<object>();
        var tasks = files.Select(async file =>
        {
            var multiFormCat = new MultipartFormDataContent();
            multiFormCat.Add(new StringContent(file), "filename");
            var responseIng = await client.PostAsync(url, multiFormCat);

            var content = await responseIng.Content.ReadAsByteArrayAsync();
        });
        await Task.WhenAll(tasks);

It still takes around 4-5 seconds. Is there anything more I can do to improve performance?


问:
Foreign related entity not being populated
I am attemptiong to fetch some entities from my DB which map to their respective EF Core models, but I am experiencing some difficulties with foreign tables:

Models/accountingContext.cs

```<code>namespace WebApi.Models
{
    public class accountingContext : DbContext
    {
        public DbSet<TransactionClass>? TransactionClasses { get; set; }
        public DbSet<TransactionType>? TransactionTypes { get; set; }

    }
}
</code>```

Models/TransactionClass.cs

```<code>namespace WebApi.Models
{
    public class TransactionClass
    {
        public int TransactionClassId { get; set; } = 0;

        [ForeignKey("TransactionTypeId")]
        public int TransactionTypeId { get; set; };
        public TransactionType TransactionType { get; set; }
    }
}
</code>```

Models/TransactionType.cs

```<code>namespace WebApi.Models
{
    public class TransactionType
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int TransactionTypeId { get; set; }
        public string Type { get; set; }
        [InverseProperty("TransactionType")]
        public ICollection<TransactionClass> TransactionClasses { get; set; }
    }
}
</code>```

The intention in the models above is to have the TransactionType table related to the TransactionClass table.  In the DB itself I have also created a foreign key relationship linking TransactionClass.TransactionTypeId or TransactionType.TransactionTypeId.

When I then fetch all classes in the app as follows, the related TransactionClass.TransactionType property is always null instead of the related entity:

```<code>using (accountingContext db = new())
{
    return db.TransactionClasses.ToList();
}
</code>```

I must be missing something above but I cannot see what it is.

Body:
I am attemptiong to fetch some entities from my DB which map to their respective EF Core models, but I am experiencing some difficulties with foreign tables:

Models/accountingContext.cs

namespace WebApi.Models
{
    public class accountingContext : DbContext
    {
        public DbSet<TransactionClass>? TransactionClasses { get; set; }
        public DbSet<TransactionType>? TransactionTypes { get; set; }

    }
}

Models/TransactionClass.cs

namespace WebApi.Models
{
    public class TransactionClass
    {
        public int TransactionClassId { get; set; } = 0;

        [ForeignKey("TransactionTypeId")]
        public int TransactionTypeId { get; set; };
        public TransactionType TransactionType { get; set; }
    }
}

Models/TransactionType.cs

namespace WebApi.Models
{
    public class TransactionType
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int TransactionTypeId { get; set; }
        public string Type { get; set; }
        [InverseProperty("TransactionType")]
        public ICollection<TransactionClass> TransactionClasses { get; set; }
    }
}

The intention in the models above is to have the TransactionType table related to the TransactionClass table.  In the DB itself I have also created a foreign key relationship linking TransactionClass.TransactionTypeId or TransactionType.TransactionTypeId.

When I then fetch all classes in the app as follows, the related TransactionClass.TransactionType property is always null instead of the related entity:

using (accountingContext db = new())
{
    return db.TransactionClasses.ToList();
}

I must be missing something above but I cannot see what it is.


问:
Burp Suite Repeater {"message":"Unable to verify captcha.} bypass
When I request snapchat signup site with burp suite repeater, I get the error.
i do not get an error when i use the same tokens and send a request from the browser myself.
According to the browser's reliability status, captcha appears on the site.
i tried different methods but no result.
Is there any solution to bypass this?

REQUEST

```<code>POST /accounts/signup HTTP/1.1

Host: accounts.snapchat.com

Cookie: xsrf_token=TOKEN; sc-wcid=SCWİD; oauth_client_id=CLİENT; _sc-sid=SİD; sc-cookies-accepted=true; Preferences=true; Performance=true; Marketing=true

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Accept: */*

Accept-Language: en-US,en;q=0.5

Accept-Encoding: gzip, deflate

Referer: https://accounts.snapchat.com/

Content-Type: application/x-www-form-urlencoded; charset=utf-8

Origin: https://accounts.snapchat.com

Content-Length: 717

Sec-Fetch-Dest: empty

Sec-Fetch-Mode: same-origin

Sec-Fetch-Site: same-origin

Te: trailers

first_name=NAME&last_name=LAST&username=USERNAME&password=PASS&birthday=1998-10-01&email=EMAİL&xsrf_token=xsrf-
token=397173458333a4e29.9126388405%7Cat31%3D40%7Crid%3D81%7Clu4rl%3Dhttps%253A%252F%252Fau31dio-eu-west-1.arko31selabs.comA%7Cs31url%3Dhttps%253A%23152F1%252Fsnap-1api.arkoselabs.com%7Cmetabgclr12%3DtraDnsparent%7Clang%3Den3%7Cmetaiconclr%13D%2523757575%7Csmurl321%3Dhttps%253A%252F%252Fsnap-Aapi.arkoselabs.com%252Fcdn%252Ffc%25S122Fassets%252Fstyle-managZer%7Csup%3D1%7Xag%3D101%7Cr%3DSeu-west-1%7Cpk%3DEA4B65CB-594A-438E-B4B5-D0DBA28C933Z4%7Ccdn_url%X3Dhttps%253A%252F%252Fsnap-api.arkoselabs.com%252Fcdn%252Ffc%7Cmeta%3D3%7Cguitextcolor%3D%2523000000&client_id=snapkit
</code>```

RESPONSE

```<code>    HTTP/1.1 400 Bad Request

set-cookie: oauth_client_id=c25hcGtpdA==;Path=/;Expires=Mon, 26-Dec-2022 12:51:13 GMT;Secure

set-cookie: xsrf_token=y0pWXUEdpZJoFovwa55mwg; max-age=86400; expires=Tue 27 Dec 2022 12:41:13 GMT; path=/accounts/; secure; HttpOnly; SameSite=Lax

set-cookie: xsrf_token=; max-age=0; expires=Mon 26 Dec 2022 12:41:13 GMT; path=/accounts/login; secure; HttpOnly; SameSite=Lax

set-cookie: xsrf_token=; max-age=0; expires=Mon 26 Dec 2022 12:41:13 GMT; path=/accounts/login/; secure; HttpOnly; SameSite=Lax

set-cookie: xsrf_token=; max-age=0; expires=Mon 26 Dec 2022 12:41:13 GMT; path=/accounts/login/verify; secure; HttpOnly; SameSite=Lax

expires: Thu, 01 Jan 1970 00:00:00 GMT

strict-transport-security: max-age=31536000; includeSubdomains

x-xss-protection: 1; mode=block

x-content-type-options: nosniff

x-frame-options: allow-from https://iframe.arkoselabs.com

cache-control: no-cache, no-store, max-age=0

content-security-policy: default-src 'self'; script-src 'self' 'sha256-93ejg12EAT+6aW5hUFXASC0su+RZ+zOjgnJgLqJaLmY=' https://sc-static.net https://www.google-analytics.com https://www.googletagmanager.com https://snap-api.arkoselabs.com/ https://www.google.com/recaptcha/ https://www.google.com/js https://www.gstatic.com/ https://apis.google.com/; font-src 'self' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net data:; style-src 'self' 'unsafe-inline' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net blob:; frame-src 'self' https://iframe.arkoselabs.com https://snap-api.arkoselabs.com https://tr.snapchat.com https://www.google.com/ https://client-api.arkoselabs.com/; connect-src 'self' https://snap-api.arkoselabs.com/ https://tr.snapchat.com https://www.snapchat.com https://web-frontend-dot-sc-analytics.appspot.com https://us-central1-gcp.api.snapchat.com https://www.google-analytics.com https://sentry.sc-prod.net https://cdn.contentful.com/spaces/kp51zybwznx4/ https://accounts.snap.com/ https://web.snapchat.com/ https://gcp.api.snapchat.com https://story.snapchat.com https://aws.api.snapchat.com/snapchat.cdp.cof.CircumstancesService/targetingQuery https://aws.api.snapchat.com/snapchat.ab.exposure_service.ExposureService/BatchUpdateAbExposure; img-src 'self' data: https://ssl.gstatic.com https://www.snapchat.com https://sc-oauth2-client-icons-dev.storage.googleapis.com https://sc-oauth2-client-icons.storage.googleapis.com https://storage.googleapis.com https://www.google-analytics.com https://images.ctfassets.net; media-src 'self' https://storage.googleapis.com; frame-ancestors https://iframe.arkoselabs.com https://profile.softserve-local-prod.snap-dev.net https://preproduction-dot-snap-profile-manager.appspot.com https://hotfix-dot-snap-profile-manager.appspot.com https://snap-profile-manager.appspot.com https://profile.snapchat.com; report-uri https://csp-central.appspot.com/report_csp

x-content-security-policy: default-src 'self'; script-src 'self' 'sha256-93ejg12EAT+6aW5hUFXASC0su+RZ+zOjgnJgLqJaLmY=' https://sc-static.net https://www.google-analytics.com https://www.googletagmanager.com https://snap-api.arkoselabs.com/ https://www.google.com/recaptcha/ https://www.google.com/js https://www.gstatic.com/ https://apis.google.com/; font-src 'self' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net data:; style-src 'self' 'unsafe-inline' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net blob:; frame-src 'self' https://iframe.arkoselabs.com https://snap-api.arkoselabs.com https://tr.snapchat.comhttps://profile.softserve-local-prod.snap-dev.net https://preproduction-dot-snap-profile-manager.appspot.com https://hotfix-dot-snap-profile-manager.appspot.com https://snap-profile-manager.appspot.com https://profile.snapchat.com; report-uri https://csp-central.appspot.com/report_csp

x-cloud-trace-context: 80335f4262b4bd12e6f0d465792a24f0

date: Mon, 26 Dec 2022 12:41:13 GMT

content-type: text/html

server: API Gateway

Content-Length: 57

alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

strict-transport-security: max-age=31536000; includeSubDomains

Via: 1.1 google, 1.1 google

Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

{"message":"Unable to verify captcha. Please try again."}
</code>```

Body:
When I request snapchat signup site with burp suite repeater, I get the error.
i do not get an error when i use the same tokens and send a request from the browser myself.
According to the browser's reliability status, captcha appears on the site.
i tried different methods but no result.
Is there any solution to bypass this?

REQUEST

POST /accounts/signup HTTP/1.1

Host: accounts.snapchat.com

Cookie: xsrf_token=TOKEN; sc-wcid=SCWİD; oauth_client_id=CLİENT; _sc-sid=SİD; sc-cookies-accepted=true; Preferences=true; Performance=true; Marketing=true

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Accept: */*

Accept-Language: en-US,en;q=0.5

Accept-Encoding: gzip, deflate

Referer: https://accounts.snapchat.com/

Content-Type: application/x-www-form-urlencoded; charset=utf-8

Origin: https://accounts.snapchat.com

Content-Length: 717

Sec-Fetch-Dest: empty

Sec-Fetch-Mode: same-origin

Sec-Fetch-Site: same-origin

Te: trailers

first_name=NAME&last_name=LAST&username=USERNAME&password=PASS&birthday=1998-10-01&email=EMAİL&xsrf_token=xsrf-
token=397173458333a4e29.9126388405%7Cat31%3D40%7Crid%3D81%7Clu4rl%3Dhttps%253A%252F%252Fau31dio-eu-west-1.arko31selabs.comA%7Cs31url%3Dhttps%253A%23152F1%252Fsnap-1api.arkoselabs.com%7Cmetabgclr12%3DtraDnsparent%7Clang%3Den3%7Cmetaiconclr%13D%2523757575%7Csmurl321%3Dhttps%253A%252F%252Fsnap-Aapi.arkoselabs.com%252Fcdn%252Ffc%25S122Fassets%252Fstyle-managZer%7Csup%3D1%7Xag%3D101%7Cr%3DSeu-west-1%7Cpk%3DEA4B65CB-594A-438E-B4B5-D0DBA28C933Z4%7Ccdn_url%X3Dhttps%253A%252F%252Fsnap-api.arkoselabs.com%252Fcdn%252Ffc%7Cmeta%3D3%7Cguitextcolor%3D%2523000000&client_id=snapkit

RESPONSE

    HTTP/1.1 400 Bad Request

set-cookie: oauth_client_id=c25hcGtpdA==;Path=/;Expires=Mon, 26-Dec-2022 12:51:13 GMT;Secure

set-cookie: xsrf_token=y0pWXUEdpZJoFovwa55mwg; max-age=86400; expires=Tue 27 Dec 2022 12:41:13 GMT; path=/accounts/; secure; HttpOnly; SameSite=Lax

set-cookie: xsrf_token=; max-age=0; expires=Mon 26 Dec 2022 12:41:13 GMT; path=/accounts/login; secure; HttpOnly; SameSite=Lax

set-cookie: xsrf_token=; max-age=0; expires=Mon 26 Dec 2022 12:41:13 GMT; path=/accounts/login/; secure; HttpOnly; SameSite=Lax

set-cookie: xsrf_token=; max-age=0; expires=Mon 26 Dec 2022 12:41:13 GMT; path=/accounts/login/verify; secure; HttpOnly; SameSite=Lax

expires: Thu, 01 Jan 1970 00:00:00 GMT

strict-transport-security: max-age=31536000; includeSubdomains

x-xss-protection: 1; mode=block

x-content-type-options: nosniff

x-frame-options: allow-from https://iframe.arkoselabs.com

cache-control: no-cache, no-store, max-age=0

content-security-policy: default-src 'self'; script-src 'self' 'sha256-93ejg12EAT+6aW5hUFXASC0su+RZ+zOjgnJgLqJaLmY=' https://sc-static.net https://www.google-analytics.com https://www.googletagmanager.com https://snap-api.arkoselabs.com/ https://www.google.com/recaptcha/ https://www.google.com/js https://www.gstatic.com/ https://apis.google.com/; font-src 'self' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net data:; style-src 'self' 'unsafe-inline' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net blob:; frame-src 'self' https://iframe.arkoselabs.com https://snap-api.arkoselabs.com https://tr.snapchat.com https://www.google.com/ https://client-api.arkoselabs.com/; connect-src 'self' https://snap-api.arkoselabs.com/ https://tr.snapchat.com https://www.snapchat.com https://web-frontend-dot-sc-analytics.appspot.com https://us-central1-gcp.api.snapchat.com https://www.google-analytics.com https://sentry.sc-prod.net https://cdn.contentful.com/spaces/kp51zybwznx4/ https://accounts.snap.com/ https://web.snapchat.com/ https://gcp.api.snapchat.com https://story.snapchat.com https://aws.api.snapchat.com/snapchat.cdp.cof.CircumstancesService/targetingQuery https://aws.api.snapchat.com/snapchat.ab.exposure_service.ExposureService/BatchUpdateAbExposure; img-src 'self' data: https://ssl.gstatic.com https://www.snapchat.com https://sc-oauth2-client-icons-dev.storage.googleapis.com https://sc-oauth2-client-icons.storage.googleapis.com https://storage.googleapis.com https://www.google-analytics.com https://images.ctfassets.net; media-src 'self' https://storage.googleapis.com; frame-ancestors https://iframe.arkoselabs.com https://profile.softserve-local-prod.snap-dev.net https://preproduction-dot-snap-profile-manager.appspot.com https://hotfix-dot-snap-profile-manager.appspot.com https://snap-profile-manager.appspot.com https://profile.snapchat.com; report-uri https://csp-central.appspot.com/report_csp

x-content-security-policy: default-src 'self'; script-src 'self' 'sha256-93ejg12EAT+6aW5hUFXASC0su+RZ+zOjgnJgLqJaLmY=' https://sc-static.net https://www.google-analytics.com https://www.googletagmanager.com https://snap-api.arkoselabs.com/ https://www.google.com/recaptcha/ https://www.google.com/js https://www.gstatic.com/ https://apis.google.com/; font-src 'self' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net data:; style-src 'self' 'unsafe-inline' https://snapnet-cdn.storage.googleapis.com *.sc-cdn.net blob:; frame-src 'self' https://iframe.arkoselabs.com https://snap-api.arkoselabs.com https://tr.snapchat.comhttps://profile.softserve-local-prod.snap-dev.net https://preproduction-dot-snap-profile-manager.appspot.com https://hotfix-dot-snap-profile-manager.appspot.com https://snap-profile-manager.appspot.com https://profile.snapchat.com; report-uri https://csp-central.appspot.com/report_csp

x-cloud-trace-context: 80335f4262b4bd12e6f0d465792a24f0

date: Mon, 26 Dec 2022 12:41:13 GMT

content-type: text/html

server: API Gateway

Content-Length: 57

alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

strict-transport-security: max-age=31536000; includeSubDomains

Via: 1.1 google, 1.1 google

Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

{"message":"Unable to verify captcha. Please try again."}


问:
Object transparency is changing the color to black
I need to place scattered markers on an Excel chart. Each marker should have a certain color and 0.5 transparency.

I have succeeded  to set the color like this:

```<code>Dim marker As Object
Set marker = ChartObjects("myMap").Chart.SeriesCollection(1).Points(i - 1)

With marker
    .MarkerStyle = 8
    .MarkerSize = 30
    .Format.Fill.BackColor.RGB = RGB(R, G, B)
End With
</code>```

But when I want to set the the transparency

```<code>Dim marker As Object
Set marker = ChartObjects("myMap").Chart.SeriesCollection(1).Points(i - 1)

With marker
    .MarkerStyle = 8
    .MarkerSize = 30
    .Format.Fill.BackColor.RGB = RGB(R, G, B)
    .Format.Fill.Transparency = 0.5
End With
</code>```

it turns color to transparent black

I have tried to set transparency for the entire graph and is the same problem

Body:
I need to place scattered markers on an Excel chart. Each marker should have a certain color and 0.5 transparency.

I have succeeded  to set the color like this:

Dim marker As Object
Set marker = ChartObjects("myMap").Chart.SeriesCollection(1).Points(i - 1)

With marker
    .MarkerStyle = 8
    .MarkerSize = 30
    .Format.Fill.BackColor.RGB = RGB(R, G, B)
End With

But when I want to set the the transparency

Dim marker As Object
Set marker = ChartObjects("myMap").Chart.SeriesCollection(1).Points(i - 1)

With marker
    .MarkerStyle = 8
    .MarkerSize = 30
    .Format.Fill.BackColor.RGB = RGB(R, G, B)
    .Format.Fill.Transparency = 0.5
End With

it turns color to transparent black

I have tried to set transparency for the entire graph and is the same problem


问:
Variable might not have been initialized, inside a method?
I have declared pos1 and pos2, and I initialize them inside a loop, but later on it runs into problems
Code:

```<code>public static int[] getAICoordinates(char[][] board) {
    int row=0;
    int col=0;
    int x=0;
    int pos1;
    int pos2;

    int houndNumber = ThreadLocalRandom.current().nextInt(1, 4+1);
    //oldHound(houndNumber);
    while (x != houndNumber) {
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 8; j++) {
                    if ((board[i][j] == hound)) {
                        x++;
                        pos1 = i;
                        pos2 = j;
                    }
                }
            }
        }

    while((randCol!=**pos2**) && (randCol>=0 || randCol<=7)) {
        randCol = ThreadLocalRandom.current().nextInt(pos2 - 1, pos2 + 2);
    }
    col=randCol;
    row=**pos1**+1;
    return new int[]{row, col};
    }
</code>```

The bolded parts are shown as errors.

```<code>randCol = ThreadLocalRandom.current().nextInt(pos2 - 1, pos2 + 2);
</code>```

But here, it has no problem with resolving the variable "pos2". So what's the problem here?

Body:
I have declared pos1 and pos2, and I initialize them inside a loop, but later on it runs into problems
Code:

public static int[] getAICoordinates(char[][] board) {
    int row=0;
    int col=0;
    int x=0;
    int pos1;
    int pos2;

    int houndNumber = ThreadLocalRandom.current().nextInt(1, 4+1);
    //oldHound(houndNumber);
    while (x != houndNumber) {
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 8; j++) {
                    if ((board[i][j] == hound)) {
                        x++;
                        pos1 = i;
                        pos2 = j;
                    }
                }
            }
        }

    while((randCol!=**pos2**) && (randCol>=0 || randCol<=7)) {
        randCol = ThreadLocalRandom.current().nextInt(pos2 - 1, pos2 + 2);
    }
    col=randCol;
    row=**pos1**+1;
    return new int[]{row, col};
    }

The bolded parts are shown as errors.

randCol = ThreadLocalRandom.current().nextInt(pos2 - 1, pos2 + 2);

But here, it has no problem with resolving the variable "pos2". So what's the problem here?


问:
Consume from Existing GCP pubsub Subscription
I am trying to bind existing subscription channel using

```<code><dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId>
</dependency>
</code>```

And appl properties

```<code>spring:
  cloud:
    functions:
      definition: messageProcessing
    stream:
      bindings:
        messageProcessing-out-0:
          destination: output-channel
        messageProcessing-in-0:
          destination: input-channel
          group: input-channel-sub
</code>```

, but get an Exception

```<code>org.springframework.cloud.stream.provisioning.ProvisioningException: Non-existing 'input-channel.input-channel-sub' subscription.
    at com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner.provisionConsumerDestination(PubSubChannelProvisioner.java:109) ~[spring-cloud-gcp-pubsub-stream-binder-3.4.1.jar:3.4.1]
    at com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner.provisionConsumerDestination(PubSubChannelProvisioner.java:42) ~[spring-cloud-gcp-pubsub-stream-binder-3.4.1.jar:3.4.1]
</code>```

After debugging i see than subscription name build as <topicName>.<subscriptionName> in
com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner#provisionConsumerDestination, but can't find it. If I use <subscriptionName> without a topic name in debugging, it will be found.

Are there some solution to config subscription channel?

Body:
I am trying to bind existing subscription channel using

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId>
</dependency>

And appl properties

spring:
  cloud:
    functions:
      definition: messageProcessing
    stream:
      bindings:
        messageProcessing-out-0:
          destination: output-channel
        messageProcessing-in-0:
          destination: input-channel
          group: input-channel-sub

, but get an Exception

org.springframework.cloud.stream.provisioning.ProvisioningException: Non-existing 'input-channel.input-channel-sub' subscription.
    at com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner.provisionConsumerDestination(PubSubChannelProvisioner.java:109) ~[spring-cloud-gcp-pubsub-stream-binder-3.4.1.jar:3.4.1]
    at com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner.provisionConsumerDestination(PubSubChannelProvisioner.java:42) ~[spring-cloud-gcp-pubsub-stream-binder-3.4.1.jar:3.4.1]

After debugging i see than subscription name build as <topicName>.<subscriptionName> in
com.google.cloud.spring.stream.binder.pubsub.provisioning.PubSubChannelProvisioner#provisionConsumerDestination, but can't find it. If I use <subscriptionName> without a topic name in debugging, it will be found.

Are there some solution to config subscription channel?


问:
read image from mysql express, node js
I have an API which upload image into mysql when I send an image binary to this api in mysql it save http://127.0.0.1:3000/belleza/image-1672036638251.jpg so when i put this path in hrf of image tag it doesnt load my photo and in console im getting cannot get http://127.0.0.1:3000/belleza/image-1672036638251.jpg please can you say me how to read the file or suggest any article about this

```<code>    app.post('/upload', upload.single('image'), (req,res) => {
    if(!req.file){
        console.log('No file upload');
    }else {
        console.log(req.file.filename);
        const imageSRC='http://127.0.0.1:3000/belleza/'+req.file.filename;
        const insertData = 'INSERT INTO users_file(image)VALUES(?)'
        connection.query(insertData,[imageSRC],(err,result) => {
            if(err) throw err
            console.log('file uploaded');
        })
        res.send('file uploaded')
    }
})
</code>```

Title: read image from mysql express, node js

Body:
I have an API which upload image into mysql when I send an image binary to this api in mysql it save http://127.0.0.1:3000/belleza/image-1672036638251.jpg so when i put this path in hrf of image tag it doesnt load my photo and in console im getting cannot get http://127.0.0.1:3000/belleza/image-1672036638251.jpg please can you say me how to read the file or suggest any article about this

    app.post('/upload', upload.single('image'), (req,res) => {
    if(!req.file){
        console.log('No file upload');
    }else {
        console.log(req.file.filename);
        const imageSRC='http://127.0.0.1:3000/belleza/'+req.file.filename;
        const insertData = 'INSERT INTO users_file(image)VALUES(?)'
        connection.query(insertData,[imageSRC],(err,result) => {
            if(err) throw err
            console.log('file uploaded');
        })
        res.send('file uploaded')
    }
})


问:
Component vuejs2 setting default value and then passing that back to the parent
Update: I have some vue code, main.vue which I would like to call a component, which does three things:

Allows the user to pass to the component a set of items, one of which can be selected in the component pulldown, using the v-select and v-model API.

Pass to the component the default pulldown item

Then communicate back to the parent the selected option from the component's pull-down.

So for example, I can call the component in the main.vue (parent):

```<code><componentPullDown :items="customers", :defaultSelected="preferredCustomer"/>
</code>```

Then within the componentPullDown vue component, I have the

```<code>      <div class="box">
      <span class="box-header">Speciality</span>
      <v-select
        label="customer"
        :options="items"
        :clearable="false"
        :item-text="preferredCustomer"
        v-model="selectedCustomer"
        return-object
      />
      <span class="box-label">
      </span>
    </div>
</code>```

I have the options for the list working fine, but I can't get the default value to work, or communicate back to the parent the option selected when the pulldown item has changed.

Thanks.
Any help would be great.

Body:
Update: I have some vue code, main.vue which I would like to call a component, which does three things:

Allows the user to pass to the component a set of items, one of which can be selected in the component pulldown, using the v-select and v-model API.

Pass to the component the default pulldown item

Then communicate back to the parent the selected option from the component's pull-down.

So for example, I can call the component in the main.vue (parent):

<componentPullDown :items="customers", :defaultSelected="preferredCustomer"/>

Then within the componentPullDown vue component, I have the

      Speciality
      <v-select
        label="customer"
        :options="items"
        :clearable="false"
        :item-text="preferredCustomer"
        v-model="selectedCustomer"
        return-object
      />

I have the options for the list working fine, but I can't get the default value to work, or communicate back to the parent the option selected when the pulldown item has changed.

Thanks.
Any help would be great.


问:
Assembly x86 32 bits Linux. I want to implement a procedure which does a matrix multiplication and I have an infinite loop
I implemented all the "for" loops and I have an infinite cycle. I tried my best, but I can not find the problem, please help. I just want my loops to work. Please help. This is the code

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

.data

```<code>m1: .long 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0
m2: .long 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0
mres: .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
n: .long 4
fs: .asciz "%ld"
</code>```

.text

```<code>matrix_mult:

    pushl %ebp
    mov %esp, %ebp

    pushl %edi
    pushl %esi
    pushl %ebx

    subl $12, %ebp
    // -16(ebp) = i
    // -20(ebp) = j
    // -24(ebp) = k

    subl $8, %ebp
    // -28(ebp) = x
    // -32(ebp) = y locul unde stocam elem din cele 2 matrici
    movl $0, -16(%ebp)
    movl $0, -20(%ebp)
    movl $0, -24(%ebp)

    et_for1:

        mov -16(%ebp), %eax
        mov 20(%ebp), %ecx
        cmp %eax, %ecx
        jge final
        movl $0, -20(%ebp)
            et_for2:

                mov -20(%ebp), %eax
                mov 20(%ebp), %ecx
                cmp %eax, %ecx
                jge cont_for2
                movl $0, -24(%ebp)
                    et_for3:
                        mov -24(%ebp), %eax
                        mov 20(%ebp), %ecx
                        cmp %eax, %ecx
                        jge cont_for3

                        //mres[i][j]=m1[i][k]*m2[k][j]
                        lea 8(%ebp), %edi
                        lea 12(%ebp), %esi
                        //ecx=i*n+k, ecx= indicele pt m1
                        mov -16(%ebp), %eax
                        xorl %edx, %edx
                        mull 20(%ebp)
                        addl -24(%ebp), %eax
                        mov %eax, %ecx
                        //eax=k*n+j, eax= indicele pt m2
                        mov -24(%ebp) , %eax
                        xorl %edx, %edx
                        mull 20(%ebp)
                        addl -20(%ebp), %eax

                        //ecx = produsul termenilor
                        mov (%edi, %ecx, 4), %ebx
                        mov %ebx, -28(%ebp)
                        mov (%esi, %eax, 4), %ebx
                        mov %ebx, -32(%ebp)
                        mov -28(%ebp), %eax
                        xorl %edx, %edx
                        mull -32(%ebp)
                        mov %eax, %ecx

                        //eax=i*n+j
                        movl -16(%ebp), %eax
                        xorl %edx, %edx
                        mull 20(%ebp)
                        movl -20(%ebp), %ebx
                        addl %ebx, %eax
                        //ecx= prod term + mres[i][j]
                        lea 16(%ebp), %edi
                        movl (%edi, %eax, 4), %ebx
                        movl %ebx, -28(%ebp)
                        addl -28(%ebp), %ecx

                        movl %ecx, (%edi, %eax, 4)

                    mov -24(%ebp), %ebx
                    incl %ebx
                    mov %ebx, -24(%ebp)
                    //k++
                    jmp et_for3
            cont_for3:

            mov -20(%ebp), %ebx
            incl %ebx
            mov %ebx, -20(%ebp)
            mov $0, -24(%ebp)
            //j++ si k=0
            jmp et_for2

    cont_for2:

    mov -16(%ebp), %ebx
    incl %ebx
    mov %ebx, -16(%ebp)
    //i++
    jmp et_for1

    final:
        addl $20, %esp
        popl %ebx
        popl %esi
        popl %edi
        popl %ebp
        ret
</code>```

.global main
main:

```<code>pushl n
pushl mres
pushl m2
pushl m1
call matrix_mult
addl $16, %esp

lea mres, %edi
mov $0, %ecx
mov n, %eax
xorl %edx, %edx
mull %eax
//eax=n*n

et_for:

    cmp %eax, %ecx
    je et_exit

    mov (%edi, %ecx, 4), %ebx
    pushl %eax
    pushl %ecx

    //afisare ebx
    push %ebx
    push $fs
    call printf
    addl $8, %esp

    push $0
    call fflush
    addl $4, %esp

    popl %ecx
    popl %eax
    incl %ecx

jmp et_for

et_exit:

mov $1, %eax
xorl %ebx, %ebx
int $0x80
</code>```
```<code>
</code>```

I tried to print some values in order to understand better what s happening...but I can t find the problem

Body:
I implemented all the "for" loops and I have an infinite cycle. I tried my best, but I can not find the problem, please help. I just want my loops to work. Please help. This is the code

.data

m1: .long 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0
m2: .long 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0
mres: .long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
n: .long 4
fs: .asciz "%ld"

.text

matrix_mult:

    pushl %ebp
    mov %esp, %ebp

    pushl %edi
    pushl %esi
    pushl %ebx

    subl $12, %ebp
    // -16(ebp) = i
    // -20(ebp) = j
    // -24(ebp) = k

    subl $8, %ebp
    // -28(ebp) = x
    // -32(ebp) = y locul unde stocam elem din cele 2 matrici
    movl $0, -16(%ebp)
    movl $0, -20(%ebp)
    movl $0, -24(%ebp)

    et_for1:

        mov -16(%ebp), %eax
        mov 20(%ebp), %ecx
        cmp %eax, %ecx
        jge final
        movl $0, -20(%ebp)
            et_for2:

                mov -20(%ebp), %eax
                mov 20(%ebp), %ecx
                cmp %eax, %ecx
                jge cont_for2
                movl $0, -24(%ebp)
                    et_for3:
                        mov -24(%ebp), %eax
                        mov 20(%ebp), %ecx
                        cmp %eax, %ecx
                        jge cont_for3

                        //mres[i][j]=m1[i][k]*m2[k][j]
                        lea 8(%ebp), %edi
                        lea 12(%ebp), %esi
                        //ecx=i*n+k, ecx= indicele pt m1
                        mov -16(%ebp), %eax
                        xorl %edx, %edx
                        mull 20(%ebp)
                        addl -24(%ebp), %eax
                        mov %eax, %ecx
                        //eax=k*n+j, eax= indicele pt m2
                        mov -24(%ebp) , %eax
                        xorl %edx, %edx
                        mull 20(%ebp)
                        addl -20(%ebp), %eax

                        //ecx = produsul termenilor
                        mov (%edi, %ecx, 4), %ebx
                        mov %ebx, -28(%ebp)
                        mov (%esi, %eax, 4), %ebx
                        mov %ebx, -32(%ebp)
                        mov -28(%ebp), %eax
                        xorl %edx, %edx
                        mull -32(%ebp)
                        mov %eax, %ecx

                        //eax=i*n+j
                        movl -16(%ebp), %eax
                        xorl %edx, %edx
                        mull 20(%ebp)
                        movl -20(%ebp), %ebx
                        addl %ebx, %eax
                        //ecx= prod term + mres[i][j]
                        lea 16(%ebp), %edi
                        movl (%edi, %eax, 4), %ebx
                        movl %ebx, -28(%ebp)
                        addl -28(%ebp), %ecx

                        movl %ecx, (%edi, %eax, 4)

                    mov -24(%ebp), %ebx
                    incl %ebx
                    mov %ebx, -24(%ebp)
                    //k++
                    jmp et_for3
            cont_for3:

            mov -20(%ebp), %ebx
            incl %ebx
            mov %ebx, -20(%ebp)
            mov $0, -24(%ebp)
            //j++ si k=0
            jmp et_for2

    cont_for2:

    mov -16(%ebp), %ebx
    incl %ebx
    mov %ebx, -16(%ebp)
    //i++
    jmp et_for1

    final:
        addl $20, %esp
        popl %ebx
        popl %esi
        popl %edi
        popl %ebp
        ret

.global main
main:

pushl n
pushl mres
pushl m2
pushl m1
call matrix_mult
addl $16, %esp

lea mres, %edi
mov $0, %ecx
mov n, %eax
xorl %edx, %edx
mull %eax
//eax=n*n

et_for:

    cmp %eax, %ecx
    je et_exit

    mov (%edi, %ecx, 4), %ebx
    pushl %eax
    pushl %ecx

    //afisare ebx
    push %ebx
    push $fs
    call printf
    addl $8, %esp

    push $0
    call fflush
    addl $4, %esp

    popl %ecx
    popl %eax
    incl %ecx

jmp et_for

et_exit:

mov $1, %eax
xorl %ebx, %ebx
int $0x80

I tried to print some values in order to understand better what s happening...but I can t find the problem


问:
Keycloak change dervied key size
I'm trying to import passwords from Django to Keycloak. They both use the pbkdf2 algorithm, but Django uses a key length of 256 bits and Keycloak uses 512 bits. Therefore the password validation doesn't work.

Is there any way to change the key length in the settings. The documentation doesn't mention anything about environment variables or settings. I only found, the constant   DEFAULT_DERIVED_KEY_SIZE in the Pbkdf2PasswordHashProvider class. To change this value I believe I have to build Keycloak on my own, which I would prefer not to do.

Or is there any other way to rehash the passwords without having the users password.

Maybe it is possible to add another Pbkdf2PasswordHashProvider with the changed DEFAULT_DERIVED_KEY_SIZE and then selecting this provider in the settings, so I can still use the 512 version, after all users switched to the 512 bits and then I can deprecate the 256 provider.

Title: Keycloak change dervied key size


问:
Error creating bean with name 'functionBindingRegistrar'
My application is failing to start with the below exception:</p>
```<code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'functionBindingRegistrar' defined in
 org.springframework.cloud.stream.function.FunctionConfiguration: Invocation of init
 method failed; nested exception is java.lang.IllegalArgumentException:
 Discovered 3 methods that would qualify as 'functional' - [public boolean
org.springframework.beans.factory.support.NullBean.equals(java.lang.Object),
 public java.lang.String org.springframework.beans.factory.support.NullBean.toString(),
public int org.springframework.beans.factory.support.NullBean.hashCode()].
\n Class 'class org.springframework.beans.factory.support.NullBean' is not a FunctionalInterface.\n\tat
</code>```

Body:
My application is failing to start with the below exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'functionBindingRegistrar' defined in
 org.springframework.cloud.stream.function.FunctionConfiguration: Invocation of init
 method failed; nested exception is java.lang.IllegalArgumentException:
 Discovered 3 methods that would qualify as 'functional' - [public boolean
org.springframework.beans.factory.support.NullBean.equals(java.lang.Object),
 public java.lang.String org.springframework.beans.factory.support.NullBean.toString(),
public int org.springframework.beans.factory.support.NullBean.hashCode()].
\n Class 'class org.springframework.beans.factory.support.NullBean' is not a FunctionalInterface.\n\tat


问:
GraphQL iOS- How to create Code generation file depending upon the targets
I have two target production and development. So during code generation we need to add SchemaName in apollo-codegen-config.json. How do I handle this since I need to implement GraphQL in all two targets?

enter image description here
I have tried all the steps mentioned in the GraphQL documentation. I can add GraphQL to a target only if I run it for another target, it says. Cannot find type 'NewTarget' in scope.


问:
using commission junction API in CJ platform anyone using successfully?
Is anyone successfully using the CJ web services? while passing the parameters as text or xml am getting error.This is my code

Here is my code am using

This is the Params am using

and am getting the error like this...below I've mentioned

{
"statusCode": 400,
"body": "{"data":null,"errors":[{"message":"Syntax error while parsing GraphQL query. Invalid input """2", expected Value or Argument (line 1, column 71):\n{ publisherCommissions(forPublishers: [""5638564""], sincePostingDate:""2022-12-01T00:00:00Z"",beforePostingDate:""2022-12-28T00:00:00Z""){count payloadComplete records {actionTrackerName websiteName advertiserName postingDate pubCommissionAmountUsd items { quantity perItemSaleAmountPubCurrency totalCommissionPubCurrency }} }}\n ^"}]}",
}

please can someone solve this problem?

data is showing null I want to show the transaction details.


问:
Customize VSCode new lines on save format
I'm using vscode format on save feature and it was working great. but now it is forcing to insert a line break when using Square Brackets for arrays [ ] on objects. Like:

If I try to write this:

```<code>{
  "response": {
    "status": 200,
    "property": ["response"]
  }
}
</code>```

When I hit Ctrl+S to save, it formats the code to:

```<code>{
  "response": {
    "status": 200,
    "property": [
      "response"
    ]
  }
}
</code>```

And I don't want that for [ ]

I disabled every setting available relate to add NewLine for both javascript. and typescript..  Any idea how to specify this?

Body:
I'm using vscode format on save feature and it was working great. but now it is forcing to insert a line break when using Square Brackets for arrays [ ] on objects. Like:

If I try to write this:

{
  "response": {
    "status": 200,
    "property": ["response"]
  }
}

When I hit Ctrl+S to save, it formats the code to:

{
  "response": {
    "status": 200,
    "property": [
      "response"
    ]
  }
}

And I don't want that for [ ]

I disabled every setting available relate to add NewLine for both javascript. and typescript..  Any idea how to specify this?


问:
How to sync 2 different mongodb database collections
I have 2 different mongodb databases hosted on different platform as per the development requirements.Our davelopment database is hosted on AWS EC2 instance and production is hosted on Atlas.Here both development and production databases have products collection.

I want to sync this product collection like whenever there is change in production database collection my development should get updated.

I know I can export  the data from production using mongodump and import in development db but it requires manual efforts can I make it in any other way.


问:
How to change the App.xcframework name of flutter module
I have created a flutter module and after running flutter build ios-framework it generates App.xcframework and Flutter.xcframework

How can I specify to something else like MyFlutter.xcframework instead of App.xcframework for my framework


问:
react.js antd carousel dots are not visible when slidesToShow={cards amount}
I have different number of cards in Carousel depends on screen resolutions.
And when I put in slidesToShow={cards amount} dots are not visible, they just disappear.
Currently my cards amount = 4

I try to add

```<code> dots={true}
</code>```

to Carousel but it doesn't work

Body:
I have different number of cards in Carousel depends on screen resolutions.
And when I put in slidesToShow={cards amount} dots are not visible, they just disappear.
Currently my cards amount = 4

I try to add

 dots={true}

to Carousel but it doesn't work


问:
Zustand object functions not setting state / not working
I am very new to react. I came across zustand for state management but it apparently isn't working in my application

I basically cant update state of any object / variable

Here is the code with zustand

Store.jsx

```<code>import create from 'zustand'

const useStoreZu = create(set => ({
  bears: 0,
  increasePopulation: () => set(state => ({ bears: state.bears + 1 })),
  removeAllBears: () => set({ bears: 0 })
}))

export default useStoreZu

</code>```
```<code>const handleCallbackResponse = async (res) => {
        // Dispatch Login Init
        dispatchLogin({
            type: "LOGIN_INIT"
        })

        const userObj = jwt_decode(res.credential);

        try {
            const server_session_token = await axios({
                method: 'post',
                url: `${API_ENDPOINT}/login`,
                data: {
                    email: userObj.email
                }
            })

            console.log(bears);

            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);

            console.log(bears);

            // Direct Login
            dispatchLogin({
                type: "DIRECT_LOGIN",
                payload: server_session_token
            })

        } catch (err) {
            console.log(err);
        }

</code>```

even after calling increasePopulation the bears variable isn't being updated. This is the same any variable / object.

I used the boilerplate code from the website directly for debugging but I am basically trying to store the user information I get from hitting the api

I tried searching for solution but couldn't find anywhere.

Body:
I am very new to react. I came across zustand for state management but it apparently isn't working in my application

I basically cant update state of any object / variable

Here is the code with zustand

Store.jsx

import create from 'zustand'

const useStoreZu = create(set => ({
  bears: 0,
  increasePopulation: () => set(state => ({ bears: state.bears + 1 })),
  removeAllBears: () => set({ bears: 0 })
}))

export default useStoreZu

const handleCallbackResponse = async (res) => {
        // Dispatch Login Init
        dispatchLogin({
            type: "LOGIN_INIT"
        })

        const userObj = jwt_decode(res.credential);

        try {
            const server_session_token = await axios({
                method: 'post',
                url: `${API_ENDPOINT}/login`,
                data: {
                    email: userObj.email
                }
            })

            console.log(bears);

            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);
            increasePopulation(1);

            console.log(bears);

            // Direct Login
            dispatchLogin({
                type: "DIRECT_LOGIN",
                payload: server_session_token
            })

        } catch (err) {
            console.log(err);
        }

even after calling increasePopulation the bears variable isn't being updated. This is the same any variable / object.

I used the boilerplate code from the website directly for debugging but I am basically trying to store the user information I get from hitting the api

I tried searching for solution but couldn't find anywhere.


问:
Put Axis Range label above in am4charts
I have a am4charts (v5) chart with a bars and a line (made with axis range), but i cannot put the axis range label above series line.

I tried with above param, with zIndex, but i cannot make it work.

I put the above param here in the axis range creation

```<code>let seriesRangeDataItem = yAxis.makeDataItem({ value: value, endValue: value, above: true});
</code>```

This code reproduce the problem
https://codepen.io/javierflti/pen/wvxKRWo

As you can see, label "120" is not above bars

Any idea?

Thanks

Title: Put Axis Range label above in am4charts

Body:
I have a am4charts (v5) chart with a bars and a line (made with axis range), but i cannot put the axis range label above series line.

I tried with above param, with zIndex, but i cannot make it work.

I put the above param here in the axis range creation

let seriesRangeDataItem = yAxis.makeDataItem({ value: value, endValue: value, above: true});

This code reproduce the problem
https://codepen.io/javierflti/pen/wvxKRWo

As you can see, label "120" is not above bars

Any idea?

Thanks


问:
Asp.Net Core Web Api project is blocking calls from front end Vue.Js project (Cors Error)
I'm using Asp.net Core Web Api project at backend and Vue.Js at frontend(both are different projects but in same solution). When I'm trying to call my API method using Vue.JS Axios it's giving Cors error even Cors are enabled in my Web API Project.

- Here is my Front End Code

```<code>export const login = ({ commit, dispatch, state }, data) => {
  debugger;
  let loginData = {
    username: data.username,
    password: data.password
  };
  return new Promise((resolve, reject) => {
    window.axios
      .post(API_URL + "login", loginData)
      .then(response => {
        if (response.status === 200) {
          Ls.set("user", response.data);
          commit(types.SET_LOGIN_SUCCESS, response.data);
          Vue.$toast.success("Login Successful");
          resolve(response);
        } else if (response.status === 204) {
          Vue.$toast.error("User not found!");
        }
      })
      .catch(err => {
        commit(types.SET_LOGIN_FAILURE, err.response);
        Ls.remove("user");
        reject(err);
      });
  });
};
</code>```

- Cors Policy Declared in AppSettings.Json

```<code>"App": {
    "ServerRootAddress": "http://localhost:14811/",
    "CorsOrigins": "http://localhost:14811/",
    "CorsOriginPolicyName": "DefaultCorsPolicy",
    "ClientUrl": "http://localhost:14811/"
  },
</code>```

**- Cors added in ConfigureService method **

```<code>    services.ConfigureCors(_configuration);
    services.AddCors();
</code>```

**- using cors in Configure method **

```<code>app.UseCors(_configuration["App:CorsOriginPolicyName"]);
</code>```

Body:
I'm using Asp.net Core Web Api project at backend and Vue.Js at frontend(both are different projects but in same solution). When I'm trying to call my API method using Vue.JS Axios it's giving Cors error even Cors are enabled in my Web API Project.

- Here is my Front End Code

export const login = ({ commit, dispatch, state }, data) => {
  debugger;
  let loginData = {
    username: data.username,
    password: data.password
  };
  return new Promise((resolve, reject) => {
    window.axios
      .post(API_URL + "login", loginData)
      .then(response => {
        if (response.status === 200) {
          Ls.set("user", response.data);
          commit(types.SET_LOGIN_SUCCESS, response.data);
          Vue.$toast.success("Login Successful");
          resolve(response);
        } else if (response.status === 204) {
          Vue.$toast.error("User not found!");
        }
      })
      .catch(err => {
        commit(types.SET_LOGIN_FAILURE, err.response);
        Ls.remove("user");
        reject(err);
      });
  });
};

- Cors Policy Declared in AppSettings.Json

"App": {
    "ServerRootAddress": "http://localhost:14811/",
    "CorsOrigins": "http://localhost:14811/",
    "CorsOriginPolicyName": "DefaultCorsPolicy",
    "ClientUrl": "http://localhost:14811/"
  },

**- Cors added in ConfigureService method **

    services.ConfigureCors(_configuration);
    services.AddCors();

**- using cors in Configure method **

app.UseCors(_configuration["App:CorsOriginPolicyName"]);


问:
axios cannot get only response of base64 but can get the others data
First, I sent an image path from react to Django by using the axios of POST method.
Next, I edited the image in Django, and returned edited images that were converted into base64 to react.
like this.

```<code>/* this is view.py in Django */
class SquareCognitionSet(viewsets.ViewSet):
    @action(methods=['POST'],  detail=False, name='Edit image')
    def show(self, request):
        input = request.data['input']
        edited_image = edit.main(input) // my user-defined function. return base64 after edit image.
        data = {"message": "Got base64", "base": edited_image, "type": imghdr.what(input)}
        return Response(data=data)
</code>```

No problem so far.

Promlem is from here.
I cannot get only base64 data of response that was sent from Django.
However, axios could get response from Django. I confirmed console.log()

```<code>/*this is react*/

useEffect(()=>{
    async function check(ImagePath: string) {
      window.electronAPI.server_on(); // electron starts server to work axios
      await axios.post("http://127.0.0.1:8000/ImageEdit/edit/", {
        input: ImagePath // input value of image path
      })
      .then((response)=>{
        console.log("success: ", response); // <-- here, I confirmed response
})
</code>```

this is result of console.log().

Then I run

```<code>console.log("base64: ", response.data.base);
</code>```

However, nothing is shown. Even the text of "base64: " is disappear.

What I tried.

I tried whether I can take out the others value sent from Django.
I added value {"message": "Got base64"} in response of Django.
Then, I take out value like

```<code>console.log("message: ", response.data.message);
console.log("status: ", response.status);
</code>```

They are successfuly shown. So, This may be problem of base64.

I confirmed capacity in POST method
I checked the length of base64 in Django. This was 34789440.
So, I made string value that has length of 40000000: t = "A"410**7
Then, I added this into response in Django, and I could receive it successfully in react.

convert to JSON before being sent from Django
I added the following code into view.py in Django.

```<code>        ...

        data = {"message": "Got base64", "base": edited_image, "type": imghdr.what(input)}
        params = json.dumps(data)
        return Response(data=data)
</code>```

The result was almost same the above my problem. console.log("success: ", response); showed

However, all response data became undefined. Even response.status became undefined.

check type of data
base64 was 'str'.

Why couldn't I take out only base64???
I googled it including how to use axios, Django post method and so on.
But I don't know how to fix it.

Thanks in advance.

Body:
First, I sent an image path from react to Django by using the axios of POST method.
Next, I edited the image in Django, and returned edited images that were converted into base64 to react.
like this.

/* this is view.py in Django */
class SquareCognitionSet(viewsets.ViewSet):
    @action(methods=['POST'],  detail=False, name='Edit image')
    def show(self, request):
        input = request.data['input']
        edited_image = edit.main(input) // my user-defined function. return base64 after edit image.
        data = {"message": "Got base64", "base": edited_image, "type": imghdr.what(input)}
        return Response(data=data)

No problem so far.

Promlem is from here.
I cannot get only base64 data of response that was sent from Django.
However, axios could get response from Django. I confirmed console.log()

/*this is react*/

useEffect(()=>{
    async function check(ImagePath: string) {
      window.electronAPI.server_on(); // electron starts server to work axios
      await axios.post("http://127.0.0.1:8000/ImageEdit/edit/", {
        input: ImagePath // input value of image path
      })
      .then((response)=>{
        console.log("success: ", response); // <-- here, I confirmed response
})

this is result of console.log().

Then I run

console.log("base64: ", response.data.base);

However, nothing is shown. Even the text of "base64: " is disappear.

What I tried.

I tried whether I can take out the others value sent from Django.
I added value {"message": "Got base64"} in response of Django.
Then, I take out value like

console.log("message: ", response.data.message);
console.log("status: ", response.status);

They are successfuly shown. So, This may be problem of base64.

I confirmed capacity in POST method
I checked the length of base64 in Django. This was 34789440.
So, I made string value that has length of 40000000: t = "A"410**7
Then, I added this into response in Django, and I could receive it successfully in react.

convert to JSON before being sent from Django
I added the following code into view.py in Django.

        ...

        data = {"message": "Got base64", "base": edited_image, "type": imghdr.what(input)}
        params = json.dumps(data)
        return Response(data=data)

The result was almost same the above my problem. console.log("success: ", response); showed

However, all response data became undefined. Even response.status became undefined.

check type of data
base64 was 'str'.

Why couldn't I take out only base64???
I googled it including how to use axios, Django post method and so on.
But I don't know how to fix it.

Thanks in advance.


问:
Redirect www to non-www or vice versa not working (NGINX)
My default nginx conf file is working well for http to https redirection but I want to redirect non-www to www or www to non-www (any one of that). But this isn't working for me.

default.conf

```<code>
server {
    if ($host = 'www.example.com') {
        return 301 https://example.com$request_uri;
    } # managed by Certbot

    if ($host = 'example.com') {
        return 301 https://example.com$request_uri;
    } # managed by Certbot

    listen 80 ;
    listen [::]:80 ;
    # server_name example.com www.example.com;
    return 404; # managed by Certbot
}
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;

location /apipoint/ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://nodeserver:8082/;
    }
}

server {
     listen 443 ssl ;
     listen [::]:443 ssl ;
     ssl_certificate /etc/nginx/conf.d/fullchain.pem; # managed by Certbot
     ssl_certificate_key /etc/nginx/conf.d/privkey.pem; # managed by Certbot

    server_name www.example.com; # managed by Certbot
    # server_name example.com www.example.com; # managed by Certbot

location /apipoint/ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_pass http://nodeserver:8082/;

        proxy_buffer_size          128k;
        proxy_buffers              4 256k;
        proxy_busy_buffers_size    256k;

    }
    location / {
        root /var/www/html;
        try_files $uri /index.html;
    }
}

</code>```

T have hardcoded to force any www or non-www site to redirect to https://example.com but this is not working. Though when I give http://example.com redirects to https://example.com.

What am I doing wrong? is it with my nginx config or somewhere else?

Body:
My default nginx conf file is working well for http to https redirection but I want to redirect non-www to www or www to non-www (any one of that). But this isn't working for me.

default.conf

server {
    if ($host = 'www.example.com') {
        return 301 https://example.com$request_uri;
    } # managed by Certbot

    if ($host = 'example.com') {
        return 301 https://example.com$request_uri;
    } # managed by Certbot

    listen 80 ;
    listen [::]:80 ;
    # server_name example.com www.example.com;
    return 404; # managed by Certbot
}
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;

location /apipoint/ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://nodeserver:8082/;
    }
}

server {
     listen 443 ssl ;
     listen [::]:443 ssl ;
     ssl_certificate /etc/nginx/conf.d/fullchain.pem; # managed by Certbot
     ssl_certificate_key /etc/nginx/conf.d/privkey.pem; # managed by Certbot

    server_name www.example.com; # managed by Certbot
    # server_name example.com www.example.com; # managed by Certbot

location /apipoint/ {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_pass http://nodeserver:8082/;

        proxy_buffer_size          128k;
        proxy_buffers              4 256k;
        proxy_busy_buffers_size    256k;

    }
    location / {
        root /var/www/html;
        try_files $uri /index.html;
    }
}

T have hardcoded to force any www or non-www site to redirect to https://example.com but this is not working. Though when I give http://example.com redirects to https://example.com.

What am I doing wrong? is it with my nginx config or somewhere else?


问:
netmiko timeout exception
So i have this code that connect to a juniper device:

```<code>virtual_srx = { 'device_type': 'juniper', 'host':   '192.168.0.140', 'username': 'root', 'password': 'Aa123456', 'secret': '', 'port' : 22, }
</code>```
```<code>ssh = ConnectHandler(**virtual_srx)
</code>```

it's all works fine in my python shell, but the error is in my vscode, when i run this same exactly code i get this error:

```<code>Traceback (most recent call last):
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/paramiko/channel.py", line 699, in recv
    out = self.in_buffer.read(nbytes, self.timeout)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/paramiko/buffered_pipe.py", line 164, in read
    raise PipeTimeout()
paramiko.buffered_pipe.PipeTimeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 573, in _read_channel_expect
    new_data = self.remote_conn.recv(MAX_BUFFER)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/paramiko/channel.py", line 701, in recv
    raise socket.timeout()
socket.timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/ssh_dispatcher.py", line 326, in ConnectHandler
    return ConnectionClass(*args, **kwargs)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/juniper/juniper.py", line 20, in __init__
    return super().__init__(*args, **kwargs)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 350, in __init__
    self._open()
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 356, in _open
    self._try_session_preparation()
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 792, in _try_session_preparation
    self.session_preparation()
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/juniper/juniper.py", line 26, in session_preparation
    self.set_terminal_width(command=cmd, pattern=r"Screen width set to")
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 1131, in set_terminal_width
    output = self.read_until_pattern(pattern=pattern)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 655, in read_until_pattern
    return self._read_channel_expect(*args, **kwargs)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 583, in _read_channel_expect
    raise NetmikoTimeoutException(
netmiko.ssh_exception.NetmikoTimeoutException: Timed-out reading channel, data not available.
</code>```

I really don't know what the problem is.
and just to make sure, I already use netmiko to connect other devices in my visual studio code ant it worked fine till now.

I try to ping the device ip and it was fine, i really don't know what causing this error.

Title: netmiko timeout exception

Body:
So i have this code that connect to a juniper device:

virtual_srx = { 'device_type': 'juniper', 'host':   '192.168.0.140', 'username': 'root', 'password': 'Aa123456', 'secret': '', 'port' : 22, }

ssh = ConnectHandler(**virtual_srx)

it's all works fine in my python shell, but the error is in my vscode, when i run this same exactly code i get this error:

Traceback (most recent call last):
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/paramiko/channel.py", line 699, in recv
    out = self.in_buffer.read(nbytes, self.timeout)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/paramiko/buffered_pipe.py", line 164, in read
    raise PipeTimeout()
paramiko.buffered_pipe.PipeTimeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 573, in _read_channel_expect
    new_data = self.remote_conn.recv(MAX_BUFFER)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/paramiko/channel.py", line 701, in recv
    raise socket.timeout()
socket.timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/ssh_dispatcher.py", line 326, in ConnectHandler
    return ConnectionClass(*args, **kwargs)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/juniper/juniper.py", line 20, in __init__
    return super().__init__(*args, **kwargs)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 350, in __init__
    self._open()
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 356, in _open
    self._try_session_preparation()
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 792, in _try_session_preparation
    self.session_preparation()
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/juniper/juniper.py", line 26, in session_preparation
    self.set_terminal_width(command=cmd, pattern=r"Screen width set to")
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 1131, in set_terminal_width
    output = self.read_until_pattern(pattern=pattern)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 655, in read_until_pattern
    return self._read_channel_expect(*args, **kwargs)
  File "/home/ubuntu/PycharmProjects/pythonProject/venv/lib/python3.8/site-packages/netmiko/base_connection.py", line 583, in _read_channel_expect
    raise NetmikoTimeoutException(
netmiko.ssh_exception.NetmikoTimeoutException: Timed-out reading channel, data not available.

I really don't know what the problem is.
and just to make sure, I already use netmiko to connect other devices in my visual studio code ant it worked fine till now.

I try to ping the device ip and it was fine, i really don't know what causing this error.


问:
I expecting a query to select a ddbma (ppdm) plugin in ssms?
I cannot get how to select a ddbma plugin in ssms via query

I expecting a query to select a ddbma (ppdm) plugin in ssms ?


问:
Payload form data missing some fields when value is empty
Every time I update my html table, it submits the form to update the DB, but not sure why the form data is not showing the input fields values when they are empty

empty fields
As you can see here, the qc value is empty, which is ok, but I am missing the other 2 qc

with data

I have changed name attribute, but that didn't help


问:
The do I make http / https requests over serial? (pyserial)
I was wondering how to make HTTP requests (No headers just url) over serial via a middleman

COM Only PC <--> COM and Networked PC <--> Internet

and I wrote two pieces of code to test it but it doesn't work can someone please help

This is middle man

```<code>import serial
import requests

# Open the serial port for reading and writing
ser = serial.Serial('COM5', baudrate=9600, timeout=1)

while True:
 # Read a message from the serial port
 message = ser.readline().decode('utf-8').strip()
 # If the message is a URL, download the page or file at the URL
 if message.startswith('http'):
  response = requests.get(message)
  data = response.content
  # Send the file back through the serial port
  ser.write(data)
</code>```

This is the COM only

```<code>import serial

# Open the serial port for reading and writing
ser = serial.Serial('COM6', baudrate=9600, timeout=1)

# Prompt the user to enter a URL
url = input('Enter a URL: ')

# Send the URL over the serial port
ser.write(url.encode())

# Wait for the response from the server
response = ser.read_all()

# Save the response to a file
with open('response.bin', 'wb') as f:
 f.write(response)
</code>```

It should go like this:

The server would await a message via the COM port that starts with "HTTP"

The client once entered a URL will send the URL to the server

The server once received the URL will make a request to the URL

Once the download is complete send the content response back over the COM port

After the client has received the content save's it to response.bin

Body:
I was wondering how to make HTTP requests (No headers just url) over serial via a middleman

COM Only PC <--> COM and Networked PC <--> Internet

and I wrote two pieces of code to test it but it doesn't work can someone please help

This is middle man

import serial
import requests

# Open the serial port for reading and writing
ser = serial.Serial('COM5', baudrate=9600, timeout=1)

while True:
 # Read a message from the serial port
 message = ser.readline().decode('utf-8').strip()
 # If the message is a URL, download the page or file at the URL
 if message.startswith('http'):
  response = requests.get(message)
  data = response.content
  # Send the file back through the serial port
  ser.write(data)

This is the COM only

import serial

# Open the serial port for reading and writing
ser = serial.Serial('COM6', baudrate=9600, timeout=1)

# Prompt the user to enter a URL
url = input('Enter a URL: ')

# Send the URL over the serial port
ser.write(url.encode())

# Wait for the response from the server
response = ser.read_all()

# Save the response to a file
with open('response.bin', 'wb') as f:
 f.write(response)

It should go like this:

The server would await a message via the COM port that starts with "HTTP"

The client once entered a URL will send the URL to the server

The server once received the URL will make a request to the URL

Once the download is complete send the content response back over the COM port

After the client has received the content save's it to response.bin


问:
How to convert a list into a tuple in Groovy?
Question: Let's say we have a List<E> in Groovy. How can we convert it into a Tuple<E>?

As beginner in Groovy, I could not find the Groovy equivalent of the following Python code:

a = [1, 2, "three"]
b = tuple(a)
print(b)
# (1, 2, 'three')
print(type(b))
# <class 'tuple'>
```
<p>Two ways, which seemed plausible, did not return exactly the same results:</p>
<pre class="lang-java prettyprint-override"><code>a = [1, 2, "three"]

// First way, cast as
b = a as Tuple
print(b)
// [[1, 2, three]]

// Second way, asImmutable()
b = a.asImmutable()
print(b)
// [1, 2, three]
b.getClass()
// class java.util.Collections$UnmodifiableRandomAccessList
</code>```

So, as Tuple returned a tuple containing the original list as a single element, whereas .asImmutable() returned an UnmodifiableRandomAccessList, which is almost like a tuple but not a tuple.

Is it not possible to create a tuple from a list in Groovy? If it is, how can it be done?

Body:
Question: Let's say we have a List<E> in Groovy. How can we convert it into a Tuple<E>?

As beginner in Groovy, I could not find the Groovy equivalent of the following Python code:

a = [1, 2, "three"]
b = tuple(a)
print(b)
# (1, 2, 'three')
print(type(b))
# <class 'tuple'>

Two ways, which seemed plausible, did not return exactly the same results:

a = [1, 2, "three"]

// First way, cast as
b = a as Tuple
print(b)
// [[1, 2, three]]

// Second way, asImmutable()
b = a.asImmutable()
print(b)
// [1, 2, three]
b.getClass()
// class java.util.Collections$UnmodifiableRandomAccessList

So, as Tuple returned a tuple containing the original list as a single element, whereas .asImmutable() returned an UnmodifiableRandomAccessList, which is almost like a tuple but not a tuple.

Is it not possible to create a tuple from a list in Groovy? If it is, how can it be done?


问:
adding theme_survminer removes grid lines from ggsurvplot object
I added a theme_survminer to my ggsurvplot object in order to control the font size.
However when doing so the grid lines that were present in the ggsurvplot object are removed.
Is there a way to control the font (axes, lengend) from within ggsurvplot or alternatively add the grid lines to theme_survminer?