问:
Xamarin App Keeps Freezing After Running MySql Query

Objective

User enters a value in a simple textbox. This value is stored in a variable and is then passed as a parameter into an SQL query. The output of this query is the final result which needs to be displayed under the textbox.

MainPage.xaml.cs

```<code>public MainPage()

        {
            InitializeComponent();
        }

        public void HandleTextChange(object sender, TextChangedEventArgs args)
        {
            Console.WriteLine(args.NewTextValue);
        }

        public void HandleEnterPress(object sender, EventArgs args)
        {
            Console.WriteLine("Enter Pressed");
            Label newTodo = new Label();
            var methodOneReturn = MethodOne(InputField.Text);
            newTodo.Text = Convert.ToString(methodOneReturn.Result);
            newTodo.FontSize = 20;
            TodoList.Children.Add(newTodo);
        }

public static async Task<Tuple<decimal>> MethodOne(string rawInput)

        {
            decimal output = 0;
            string strConnectionString = "some string";
            var conn = new MySqlConnection(strConnectionString);

            try
            {
                conn.Open();
            }
            catch (Exception ex)
            {
                Console.WriteLine(System.Convert.ToString(ex));
            }

            using (var command = conn.CreateCommand())
            {
                command.CommandText = $@"MySql Query {rawInput}";

                using (MySqlDataReader reader = (MySqlDataReader) await command.ExecuteReaderAsync())
                {
                    while (await reader.ReadAsync())
                    {
                        output = reader.GetDecimal(0);
                        //Console.WriteLine($"Reading from table: {reader.GetDecimal(0):C2}");
                    }
                }
            }

            return Tuple.Create(output);
        }
</code>```

MainPage.xaml

```<code><?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ToDoListApp.MainPage">

    <StackLayout>

        <Frame BackgroundColor="Gray" Padding="10,5,10,5"  CornerRadius="0">
            <Entry Text=""
                   Background="White"
                   Placeholder="Enter a ToDo"
                   TextChanged="HandleTextChange"
                   Completed="HandleEnterPress"
                   x:Name="InputField"
            />
        </Frame>

        <StackLayout x:Name="TodoList">
        </StackLayout>
    </StackLayout>
</ContentPage>
</code>```

Problem

When a snippet of .CS code (Tuple Method) is ran in console program, it runs perfectly fine. However, when the same code is ran in Xamarin app (android), after entering string in textbox, the app freezes. In debugging mode, the app freezes after executing this line:

```<code>using (MySqlDataReader reader = (MySqlDataReader) await command.ExecuteReaderAsync())
</code>```

Your help will be much appreciated.
Thank You.

Body:
Objective

User enters a value in a simple textbox. This value is stored in a variable and is then passed as a parameter into an SQL query. The output of this query is the final result which needs to be displayed under the textbox.

MainPage.xaml.cs

public MainPage()

        {
            InitializeComponent();
        }

        public void HandleTextChange(object sender, TextChangedEventArgs args)
        {
            Console.WriteLine(args.NewTextValue);
        }

        public void HandleEnterPress(object sender, EventArgs args)
        {
            Console.WriteLine("Enter Pressed");
            Label newTodo = new Label();
            var methodOneReturn = MethodOne(InputField.Text);
            newTodo.Text = Convert.ToString(methodOneReturn.Result);
            newTodo.FontSize = 20;
            TodoList.Children.Add(newTodo);
        }

public static async Task<Tuple<decimal>> MethodOne(string rawInput)

        {
            decimal output = 0;
            string strConnectionString = "some string";
            var conn = new MySqlConnection(strConnectionString);

            try
            {
                conn.Open();
            }
            catch (Exception ex)
            {
                Console.WriteLine(System.Convert.ToString(ex));
            }

            using (var command = conn.CreateCommand())
            {
                command.CommandText = $@"MySql Query {rawInput}";

                using (MySqlDataReader reader = (MySqlDataReader) await command.ExecuteReaderAsync())
                {
                    while (await reader.ReadAsync())
                    {
                        output = reader.GetDecimal(0);
                        //Console.WriteLine($"Reading from table: {reader.GetDecimal(0):C2}");
                    }
                }
            }

            return Tuple.Create(output);
        }

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="ToDoListApp.MainPage">

    <StackLayout>

        <Frame BackgroundColor="Gray" Padding="10,5,10,5"  CornerRadius="0">
            <Entry Text=""
                   Background="White"
                   Placeholder="Enter a ToDo"
                   TextChanged="HandleTextChange"
                   Completed="HandleEnterPress"
                   x:Name="InputField"
            />
        </Frame>

        <StackLayout x:Name="TodoList">
        </StackLayout>
    </StackLayout>
</ContentPage>

Problem

When a snippet of .CS code (Tuple Method) is ran in console program, it runs perfectly fine. However, when the same code is ran in Xamarin app (android), after entering string in textbox, the app freezes. In debugging mode, the app freezes after executing this line:

using (MySqlDataReader reader = (MySqlDataReader) await command.ExecuteReaderAsync())

Your help will be much appreciated.
Thank You.


来源: stackexchange

问:
crossorigin="use-credentials" for PWA with HTTP auth not working on iPad
I got a PWA with a htpasswd protection. It works on Chrome on my Macbook (I go to the URL, enter username and password, got the little icon that a PWA was detected and can install and use it) and also on my Android phone.

With Safari on the iPad it doesn't work though, as the Safari gets a 401 when it tries to load the manifest file. I did add a crossorigin attribute to the link tag, as is suggested in many solutions, but still it doesn't work. I can add it to the homescreen, but just as a link. As soon as I remove the password protection Safari can load the manifest file and install it as a PWA.

ContentLicense: CC BY-SA 4.0


问:
How to create colSpan using Flutter like layout bellow
i'm running issue with Flutter, i need to create a layout like capture bellow using GridView because data come from api.

With Kotlin I can do it very well with the GridLayoutManager

val layoutManager = binding.recyclerView.layoutManager as GridLayoutManager
layoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
    override fun getSpanSize(position: Int): Int {
        return if (position == 0) {
            3
        } else {
            1
        }
    }
}
```

but how to do the same thing on flutter?

Body:
i'm running issue with Flutter, i need to create a layout like capture bellow using GridView because data come from api.

With Kotlin I can do it very well with the GridLayoutManager

val layoutManager = binding.recyclerView.layoutManager as GridLayoutManager
layoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
    override fun getSpanSize(position: Int): Int {
        return if (position == 0) {
            3
        } else {
            1
        }
    }
}

but how to do the same thing on flutter?


问:
How do I use where clause when querying Many to Many polymorphic relation?
I have 3 Models RecordA, RecordB, Report. RecordA and RecordB have many to many polymorphic relation to Report. I would like to ask if it is possible to get Reports from Records that have e.g. created_at older than updated_at on Record.</p>
```<code>class RecordA extends Model
{
  protected $guarded = ['id'];

  public function reports()
  {
    return $this->morphToMany(
      Report::class,
      'record',
      'record_report',
    );
  }
}

class RecordB extends Model
{
  protected $guarded = ['id'];

  public function reports()
  {
    return $this->morphToMany(
      Report::class,
      'record',
      'record_report',
    );
  }
}

class Report extends Model
{
  protected $guarded = ['id'];

  public function records_a()
  {
    return $this->morphedByMany(
      RecordA::class,
      'record',
      'record_report',
    );
  }

  public function records_b()
  {
    return $this->morphedByMany(
      RecordB::class,
      'record',
      'record_report',
    );
  }
}
</code>```

Body:
I have 3 Models RecordA, RecordB, Report. RecordA and RecordB have many to many polymorphic relation to Report. I would like to ask if it is possible to get Reports from Records that have e.g. created_at older than updated_at on Record.

class RecordA extends Model
{
  protected $guarded = ['id'];

  public function reports()
  {
    return $this->morphToMany(
      Report::class,
      'record',
      'record_report',
    );
  }
}

class RecordB extends Model
{
  protected $guarded = ['id'];

  public function reports()
  {
    return $this->morphToMany(
      Report::class,
      'record',
      'record_report',
    );
  }
}

class Report extends Model
{
  protected $guarded = ['id'];

  public function records_a()
  {
    return $this->morphedByMany(
      RecordA::class,
      'record',
      'record_report',
    );
  }

  public function records_b()
  {
    return $this->morphedByMany(
      RecordB::class,
      'record',
      'record_report',
    );
  }
}


问:
Downgrading from net6 to net5 returns a 500.30 error: cannot find system.runtime v6.0.0
I've deployed a site to IIS with <TargetFramework>net6</TargetFramework> and it works as expected on both my machine (debugging from VS) and when deployed to my prod server.

For reasons, I needed to downgrade to <TargetFramework>net5</TargetFramework> and it again works as expected on my machine (debugging from VS), but now fails with "500.30 - asp.net core app failed to start".

The error (edited for brevity):

CoreCLR version 5.0.1422.5710 .NET version: 5.0.14

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0..

the server has microsoft.aspnetcore and microsoft.netcore runtimes 3 - 6 and no sdk's

my dev machine has microsoft.aspnetcore, microsoft.netcore and microsoft.windowsdesktop sdks and runtimes form  3 - 6

I'm using the same azure pipeline to build and release with the exception that I changed the "Use .NET Core" task to require sdk 5.x from 6.x

What am I possibly overlooking? This should be simple.


问:
Swap values of variables
Good day,

Could you please explain in what order the code executes.

```<code>variable_1 = 1
variable_2 = 2

variable_1, variable_2 = variable_2, variable_1
</code>```

Why is the output 2,1 and not 2,2?
Isn't variable_1 already become of value 2?

Title: Swap values of variables

Body:
Good day,

Could you please explain in what order the code executes.

variable_1 = 1
variable_2 = 2

variable_1, variable_2 = variable_2, variable_1

Why is the output 2,1 and not 2,2?
Isn't variable_1 already become of value 2?


问:
MySql 8.0 Aurora RDS not cleaning up idle connections that exceed wait_timeout
We've recently upgraded from Aurora/RDS MySql 5.6 to 8.0.  We're now seeing that our sleeping processes that are idle for more than the defined 250s wait_timeout and 250s interactive_timeout are not being cleaned up.  Additionally, it doesn't even seem to be an issue with incorrectly setting those values, because the default of 28800 (8hrs) is also surpassed and isn't cleaned up.

It appears that the AWS RDS/Aurora process isn't cleaning this up for 8.0, but it does just fine in 5.6.

UPDATE:  We've been informed by the Aurora team at AWS that the issue has been identified as an issue with the Aurora engine version 3.  It will take some time to patch, and for now we will be implementing a work-around by scheduling manual clean-up of idle processes that have exceeded the timeout duration.


问:
stream is not readable for 'raw-body' package in nest.js
I try to get a raw webhook body using 'raw-body' package.
I get an error stream is not readable.

I know that in Nest.js there's an explicit solution for this, but I want to try this package intentionally.

Here is my code:

```<code>import { AppService } from './app.service';
import { Controller, Post, Req} from '@nestjs/common';
const getRawBody = require('raw-body')

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}
  @Post()
  async customerDataRequestSend(@Req() req) {
    const rawBody = await getRawBody(req)
    console.log(rawBody)
  }

}
</code>```

Thanks in advance!

Body:
I try to get a raw webhook body using 'raw-body' package.
I get an error stream is not readable.

I know that in Nest.js there's an explicit solution for this, but I want to try this package intentionally.

Here is my code:

import { AppService } from './app.service';
import { Controller, Post, Req} from '@nestjs/common';
const getRawBody = require('raw-body')

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}
  @Post()
  async customerDataRequestSend(@Req() req) {
    const rawBody = await getRawBody(req)
    console.log(rawBody)
  }

}

Thanks in advance!


问:
OpenCL performance under OSX Lion
I have bitcoin miner which is using OpenCL kernel. Windows and Linux implementations of ATI SDK has comparable performance while Apple's native OpenCL implementation works too bad. I want to know if I can profile opencl kernel somehow to optimize it for Lion's OpenCL implementation</p>

ContentLicense: CC BY-SA 3.0

Title: OpenCL performance under OSX Lion


问:
Getting unique values from a csv file, and output into a new file
I am trying to get the unique values from a csv file. Here's an example of the file:

```<code>12,life,car,good,exellent
10,gift,truck,great,great
11,time,car,great,perfect
</code>```

The desired output in the new file is this: (the search pattern was "great")

```<code>10,gift,truck,great
11,time,car,great
</code>```

Here is my code:

```<code>def select_rows(in_file, out_file, indices):
    fname = open('sample-data.txt')
    fout = open('output-row.txt', 'w')

# get the header line
    header = fname.readline()
    fout.write(header)

# read the data
    for line in fname:
        cols = line.strip().split(',')
        row_num = int(cols[0])
        if row_num in []:
            fout.write(line)

    fout.close()
    fname.close()
</code>```

The code currently outputs:

```<code>12,life,car,good,exellent
</code>```

How can I fix this?

Body:
I am trying to get the unique values from a csv file. Here's an example of the file:

12,life,car,good,exellent
10,gift,truck,great,great
11,time,car,great,perfect

The desired output in the new file is this: (the search pattern was "great")

10,gift,truck,great
11,time,car,great

Here is my code:

def select_rows(in_file, out_file, indices):
    fname = open('sample-data.txt')
    fout = open('output-row.txt', 'w')

# get the header line
    header = fname.readline()
    fout.write(header)

# read the data
    for line in fname:
        cols = line.strip().split(',')
        row_num = int(cols[0])
        if row_num in []:
            fout.write(line)

    fout.close()
    fname.close()

The code currently outputs:

12,life,car,good,exellent

How can I fix this?


问:
visual studio - i cant open live server
i installed the live server on my visual studio but i cant open it. i already uninstalled the visual code and installed again, but the problem persist the message that shows when i try to open is this one

Open a folder or workspace...(file-> Open Folder)
Source Live server (extension).

When i click to stop it, it says that

Server is not already running

I dont know what to do

i already uninstalled the visual code and installed again, but the problem persist

Title: visual studio - i cant open live server


问:
How to save current scene play in unity
there is a mobile game with 30 levels that I am currently making. What I want is that if the player leaves the game at level 10, it will continue at 10. lv when he comes back, how can I do that?

```<code>public void loadgame()
    {
        SceneManager.LoadScene(PlayerPrefs.GetInt("Level"));
        print("Game loaded!");
    }
    public void SaveGame()
    {
        PlayerPrefs.SetInt("Level", SceneManager.GetActiveScene().buildIndex);
        PlayerPrefs.Save();
        print("Game saved!");
    }
</code>```

I'm writing inside the start function but when I start the game it constantly restarts the current scene

Title: How to save current scene play in unity

Body:
there is a mobile game with 30 levels that I am currently making. What I want is that if the player leaves the game at level 10, it will continue at 10. lv when he comes back, how can I do that?

public void loadgame()
    {
        SceneManager.LoadScene(PlayerPrefs.GetInt("Level"));
        print("Game loaded!");
    }
    public void SaveGame()
    {
        PlayerPrefs.SetInt("Level", SceneManager.GetActiveScene().buildIndex);
        PlayerPrefs.Save();
        print("Game saved!");
    }

I'm writing inside the start function but when I start the game it constantly restarts the current scene


问:
Not able to manually type a password when AutoFill functionality is enabled with two textfields

I have two textfields namely Password and Confirm Password. The problem is that if I have autofill password functionality enabled from Settings App, I can type password manually via the keyboard in the Password field but if I then go to the Confirm Password field, it automatically fills in the strong autofill password. Hence, I cannot type a password manually in both the fields.

I am using RxSwift but hopefully that doesn't have any impact on this. All I have done is:

```<code>passwordTextField.isSecureEntry = true
passwordTextField.textContentType = .newPassword

confirmPasswordTextField.isSecureEntry = true
confirmPasswordTextField.textContentType = .newPassword

</code>```

Even tried setting one of the field's textContentType to .password and the other one to .newPassword, but it doesn't work. I do want both autofill and manual typing functionality. I can fill in password manually in one field but when I tap the other field, both fields change to strong password automatically.

Body:
I have two textfields namely Password and Confirm Password. The problem is that if I have autofill password functionality enabled from Settings App, I can type password manually via the keyboard in the Password field but if I then go to the Confirm Password field, it automatically fills in the strong autofill password. Hence, I cannot type a password manually in both the fields.

I am using RxSwift but hopefully that doesn't have any impact on this. All I have done is:

passwordTextField.isSecureEntry = true
passwordTextField.textContentType = .newPassword

confirmPasswordTextField.isSecureEntry = true
confirmPasswordTextField.textContentType = .newPassword

Even tried setting one of the field's textContentType to .password and the other one to .newPassword, but it doesn't work. I do want both autofill and manual typing functionality. I can fill in password manually in one field but when I tap the other field, both fields change to strong password automatically.


问:
Display: flex; no longer resizes my box if the box is put inside another div
I'm using display:flex so that my boxes are lined up nicely and resize to the window. When I put my headers into another div they continue to be lined up correctly, but no longer resize to my smaller window. Why is this? How can I work around this, since I want to keep that function.

Here is my code:

`

```<code><div class="flexbox-container-row">
                <div>
                    <h3 class="box">
                        Reflektion
                    </h3>
                </div>

                <div>
                    <h3 class="box">
                        Tips & Trix
                    </h3>
                </div>

                <div>
                    <h3 class="box">
                        Information
                    </h3>
                </div>

</div>
</code>```

`

I tried making another div to hold a column under each header, but when I created the div to hold the new flexbox column the div removed the resizing function of the box around the header.

Body:
I'm using display:flex so that my boxes are lined up nicely and resize to the window. When I put my headers into another div they continue to be lined up correctly, but no longer resize to my smaller window. Why is this? How can I work around this, since I want to keep that function.

Here is my code:

`

                        Reflektion

                        Tips & Trix

                        Information

`

I tried making another div to hold a column under each header, but when I created the div to hold the new flexbox column the div removed the resizing function of the box around the header.


问:
Button group loses style when I connect it with NavLink
Good evening. I'd like to use the Material UI Button group component, but when using NavLink inside each button, it doesn't preserve styles.

Image preview

And how do I have the component:

```<code>export default function BasicButtonGroup() {
  const classes = useStyles();

  return (
    <div className={classes.root}>
      <ButtonGroup color="primary" aria-label="outlined primary button group">
        <NavLink to="/one/" style={{ textDecoration: "none" }}>
          <Button>One</Button>
        </NavLink>
        <Button>Two</Button>
        <Button>Three</Button>
      </ButtonGroup>
    </div>
  );
}
</code>```

Body:
Good evening. I'd like to use the Material UI Button group component, but when using NavLink inside each button, it doesn't preserve styles.

Image preview

And how do I have the component:

export default function BasicButtonGroup() {
  const classes = useStyles();

  return (

      <ButtonGroup color="primary" aria-label="outlined primary button group">
        <NavLink to="/one/" style={{ textDecoration: "none" }}>
          <Button>One</Button>
        </NavLink>
        <Button>Two</Button>
        <Button>Three</Button>
      </ButtonGroup>

  );
}


问:
Model.fit function is returning value error in incompatibale shape while using it in Spektral
I was trying spektral to train a basic GNN mode. I followed documentation perfectly and even tried transforming and splitting the dataset and feeding data into the fit function in that process. Unfortunately, I am still getting the annoying value error: Shapes (None, None) and (None, None, 2) are incompatible

I had used the TUDataset. At this point, I am not sure what I am doing wrong. Any heads-up/help will be really appreciated.

Code: https://github.com/sleeping-cat4/Intro-to-GNN-Tensorflow-/blob/main/Intro_to_GNNs_using_Tensorflow_and_Spektral.ipynb


问:
JSON Serialization DateOnly API, 'Cannot get the value of a token type 'StartObject' as a string.'
I have an application which is getting some data from a database and making some CRUD operations on them. I'm trying to make a HttpPut with a DateOnly type.

So I have a DateOnly Converter that I call in the Program.cs.

```<code>  public class DateOnlyJsonConverter : JsonConverter<DateOnly>
    {
        private const string Format = "yyyy-MM-dd";

        public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            return DateOnly.ParseExact(reader.GetString(), Format, CultureInfo.InvariantCulture);
        }

        public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
        {
            writer.WriteStringValue(value.ToString(Format, CultureInfo.InvariantCulture));
        }
    }
</code>```
```<code>builder.Services.AddControllers().AddJsonOptions(
    options =>
    {
        options.JsonSerializerOptions.Converters.Add(new DateOnlyJsonConverter());
    }
);
</code>```

And I have the Model and Dto.

```<code>  public class CelestialObjectEntity
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public string? Name { get; set; }
        public double Mass { get; set; }
        public double EquatorialDiameter { get; set; }
        public int SurfaceTemperature { get; set; }
        [JsonConverter(typeof(DateOnlyJsonConverter))]
        public DateOnly DiscoveryDate { get; set; }
        public int DiscoverySourceId { get; set; }
        public DiscoverySources DiscoverySource { get; set; }
    }
</code>```
```<code>public class CelestialObjectDto
    {
        public int Id { get; set; }
        public string? Name { get; set; }
        public double Mass { get; set; }
        public double EquatorialDiameter { get; set; }
        public int SurfaceTemperature { get; set; }
        [JsonConverter(typeof(DateOnlyJsonConverter))]
        public DateOnly DiscoveryDate { get; set; }
        public DiscoverySources DiscoverySource { get; set; }
    }
</code>```

I also have a Service class where i use Automapper and a Controller class where I do the HttPost.

```<code>public CelestialObjectDto AddCelestialObject(CelestialObjectForCreatingDto celestialObject)
        {

            var celestialNew = _mapper.Map<CelestialObjectEntity>(celestialObject);

            celestialObjectRepository.AddCelestialObject(celestialNew);

            var createdCelestialObject = _mapper.Map<CelestialObjectDto>(celestialNew);

            return createdCelestialObject;
        }
</code>```
```<code>[HttpPost("add/{id}")]
        public IActionResult AddCelestialObject(CelestialObjectForCreatingDto? discovery)
        {
            CelestialObjectDto celestialObject;
            try
            {
                celestialObject =  celestialObjectService.AddCelestialObject(discovery);
            }
            catch (Exception ex)
            {
                return NoContent();
            }

            return Json(celestialObject);
        }
</code>```

The problem is that when I try to make a HttpPut or HttpPost I have the next error in the DateOnlyConverter:

'Cannot get the value of a token type 'StartObject' as a string.'

Body:
I have an application which is getting some data from a database and making some CRUD operations on them. I'm trying to make a HttpPut with a DateOnly type.

So I have a DateOnly Converter that I call in the Program.cs.

  public class DateOnlyJsonConverter : JsonConverter<DateOnly>
    {
        private const string Format = "yyyy-MM-dd";

        public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            return DateOnly.ParseExact(reader.GetString(), Format, CultureInfo.InvariantCulture);
        }

        public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
        {
            writer.WriteStringValue(value.ToString(Format, CultureInfo.InvariantCulture));
        }
    }

builder.Services.AddControllers().AddJsonOptions(
    options =>
    {
        options.JsonSerializerOptions.Converters.Add(new DateOnlyJsonConverter());
    }
);

And I have the Model and Dto.

  public class CelestialObjectEntity
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public string? Name { get; set; }
        public double Mass { get; set; }
        public double EquatorialDiameter { get; set; }
        public int SurfaceTemperature { get; set; }
        [JsonConverter(typeof(DateOnlyJsonConverter))]
        public DateOnly DiscoveryDate { get; set; }
        public int DiscoverySourceId { get; set; }
        public DiscoverySources DiscoverySource { get; set; }
    }

public class CelestialObjectDto
    {
        public int Id { get; set; }
        public string? Name { get; set; }
        public double Mass { get; set; }
        public double EquatorialDiameter { get; set; }
        public int SurfaceTemperature { get; set; }
        [JsonConverter(typeof(DateOnlyJsonConverter))]
        public DateOnly DiscoveryDate { get; set; }
        public DiscoverySources DiscoverySource { get; set; }
    }

I also have a Service class where i use Automapper and a Controller class where I do the HttPost.

public CelestialObjectDto AddCelestialObject(CelestialObjectForCreatingDto celestialObject)
        {

            var celestialNew = _mapper.Map<CelestialObjectEntity>(celestialObject);

            celestialObjectRepository.AddCelestialObject(celestialNew);

            var createdCelestialObject = _mapper.Map<CelestialObjectDto>(celestialNew);

            return createdCelestialObject;
        }

[HttpPost("add/{id}")]
        public IActionResult AddCelestialObject(CelestialObjectForCreatingDto? discovery)
        {
            CelestialObjectDto celestialObject;
            try
            {
                celestialObject =  celestialObjectService.AddCelestialObject(discovery);
            }
            catch (Exception ex)
            {
                return NoContent();
            }

            return Json(celestialObject);
        }

The problem is that when I try to make a HttpPut or HttpPost I have the next error in the DateOnlyConverter:

'Cannot get the value of a token type 'StartObject' as a string.'


问:
Can you get user input in Google Chat Webhooks?
Just wondering like if someone sends a specific text the google chat webhook will say something. Is this possible? Thanks.</p>


问:
.NET Console APP MySQL 8 The program has exited with code -1073740940 (0xc0000374)
I have moved my vb.net/C# code to Azure hosting (Server 2019) and am now using MySQL v8 vs previously MySQL v5.6, with Oracle ODBC Connector 8.  All of my concole apps connects and reads fine.  But when there are inserts/updates/delete queries, VS 2019 console hangs, then closes.  It can be after 5 records, or 100s that this behavior happens.  It seems like the database connection is lost, but I can't figure out if that is the issue or not.  I have MSBuild set to Diagnostic, and this is the only error I receive:

```<code>The program has exited with code -1073740940 (0xc0000374)
</code>```

VS code has no external dlls, no 3rd party. Very simple odbc connection.  VS debut and ODBC driver are both x86.

I need help with VS debugging to find where the problem exists, and hopefully how to resolve it.

I have ran a trace with ODBC driver with no helpful data provided.  I have excluded our Antivirus from the project folder with the EXE exists.  I have installed MYSQL 8 on the localhost, used both 64bit and 32bit MySQL and ODBC drivers, same results.

Body:
I have moved my vb.net/C# code to Azure hosting (Server 2019) and am now using MySQL v8 vs previously MySQL v5.6, with Oracle ODBC Connector 8.  All of my concole apps connects and reads fine.  But when there are inserts/updates/delete queries, VS 2019 console hangs, then closes.  It can be after 5 records, or 100s that this behavior happens.  It seems like the database connection is lost, but I can't figure out if that is the issue or not.  I have MSBuild set to Diagnostic, and this is the only error I receive:

The program has exited with code -1073740940 (0xc0000374)

VS code has no external dlls, no 3rd party. Very simple odbc connection.  VS debut and ODBC driver are both x86.

I need help with VS debugging to find where the problem exists, and hopefully how to resolve it.

I have ran a trace with ODBC driver with no helpful data provided.  I have excluded our Antivirus from the project folder with the EXE exists.  I have installed MYSQL 8 on the localhost, used both 64bit and 32bit MySQL and ODBC drivers, same results.


问:
Flutter: FAILURE: Build failed with an exception. CompileSdk 33
I am having issue while building my Flutter Android project. Flutter doctor does not return any issue and only error that my I am getting in console is:</p>
```<code>FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\nkara\Documents\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\nkara\Documents\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
</code>```

Body:
I am having issue while building my Flutter Android project. Flutter doctor does not return any issue and only error that my I am getting in console is:

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\nkara\Documents\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\nkara\Documents\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1


问:
How to train dataset instead of api downloader in gensim?
I have been working with plagiarism detection, so, for Softcosine similarity, I need to use Gensim. Here is the code where dataset is used by api. How can I use custom dataset instead of downloading through API?

```<code>import gensim.downloader as api
model = api.load('word2vec-google-news-300')

from gensim.similarities import SparseTermSimilarityMatrix, WordEmbeddingSimilarityIndex
termsim_index = WordEmbeddingSimilarityIndex(model)
termsim_matrix = SparseTermSimilarityMatrix(termsim_index, dictionary, tfidf)
</code>```

The link to the instruction is below - https://radimrehurek.com/gensim/auto_examples/tutorials/run_scm.html#:~:text=Soft%20Cosine%20Measure%20(SCM)%20is%20a%20method%20that%20allows%20us,4%5D%20vector%20embeddings%20of%20words.

I need to train my custom dataset, instead of using "word2vec-google-news-300" dataset.

Body:
I have been working with plagiarism detection, so, for Softcosine similarity, I need to use Gensim. Here is the code where dataset is used by api. How can I use custom dataset instead of downloading through API?

import gensim.downloader as api
model = api.load('word2vec-google-news-300')

from gensim.similarities import SparseTermSimilarityMatrix, WordEmbeddingSimilarityIndex
termsim_index = WordEmbeddingSimilarityIndex(model)
termsim_matrix = SparseTermSimilarityMatrix(termsim_index, dictionary, tfidf)

The link to the instruction is below - https://radimrehurek.com/gensim/auto_examples/tutorials/run_scm.html#:~:text=Soft%20Cosine%20Measure%20(SCM)%20is%20a%20method%20that%20allows%20us,4%5D%20vector%20embeddings%20of%20words.

I need to train my custom dataset, instead of using "word2vec-google-news-300" dataset.


问:
how to do opacity fade in / fade out in a WPF UI?
im Trying to make Opacity Fade in / fade out with the DynamicResource style
using this code and it doesnt work, please help me out here! :D</p>
```<code>            if (CheckBox_checked.Checked == true)
            {
                ActiveForm.Opacity = 0.75;
            }

            if (CheckBox_checked.Checked == false)
            {
                ActiveForm.Opacity = 1.00;
            }
</code>```

Body:
im Trying to make Opacity Fade in / fade out with the DynamicResource style
using this code and it doesnt work, please help me out here! :D

            if (CheckBox_checked.Checked == true)
            {
                ActiveForm.Opacity = 0.75;
            }

            if (CheckBox_checked.Checked == false)
            {
                ActiveForm.Opacity = 1.00;
            }


问:
How to create sub list in REST Reactive Spring
I am writing a test REST API application on Spring webFlux and R2DBC. The problem is that the list of articles, which is attached to the product can not be formed before sending it to the client.

Current response:

```<code>{
    "id": 1,
    "name": "test1",
    "description": "test description",
    "implement_cost": 200.0,
    "article_ids": {
        "scanAvailable": true,
        "prefetch": -1
    }
}
</code>```

expected response:

```<code>{
    "id": 1,
    "name": "test1",
    "description": "test description",
    "implement_cost": 200.0,
    "article_ids": [
        1,
        2
    ]
}
</code>```

How can I form sub-list for response?

Blocking operations are prohibited.

block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-tcp-nio-1 create array from flux

I have product with list of attached articles.

```<code>package ru.serov.distask.model;

import lombok.Data;
import reactor.core.publisher.Flux;
import ru.serov.distask.dao.repository.enity.ArticleEntity;

@Data
public class Product {
    private Long id;
    private String name;
    private String description;
    private Float implementCost;
    private Flux<ArticleEntity> articles;
}

</code>```
```<code>public class ArticleEntity {
    @Id
    @Column(value = "id")
    private Long id;
    @Column(value = "product_id")
    private Long productId;
    @Column(value = "name")
    private String name;
    @Column(value = "content")
    private String content;
    @Column(value = "create_date")
    private LocalDate createDate;
}

</code>```

To create a product, I make a separate request for articles to ReactiveCrudRepository:

```<code>package ru.serov.distask.dao.repository;

import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import ru.serov.distask.dao.repository.enity.ArticleEntity;

public interface IArticleEntityRepo extends ReactiveCrudRepository<ArticleEntity, Long> {

    @Query(value = "DELETE FROM company.articles WHERE product_id = $1")
    Mono<Void> deleteArticlesByProductId(Long productId);

    @Query(value = "SELECT * FROM company.articles WHERE  product_id = $1")
    Flux<ArticleEntity> findAllByProductId(Long productId);
}

</code>```

after that I use the service to form the product. I use MapStruct as map auto-generator.

```<code>@Override
public Mono<Product> getProductById(Long id) {
    return productEntityService
            .getProductById(id)
            .flatMap(product -> articleEntityService
                    .getArticlesByProductId(id)
                    .collectList()
                    .map(articles -> mapper.entityToProduct(product, Flux.fromIterable(articles))));

}
</code>```

Product RESTcontroller

```<code>@GetMapping("/{id}")
Mono<ArticleDTO> getArticleById(@PathVariable Long id) {
    return articleService
            .getArticleById(id)
            .flatMap(article -> Mono.just(articleMapper.entityToDTO(article)));
}
</code>```

Mapper to ArticleDTO

```<code>@Mapper(componentModel = "spring")
public interface IProductDTOProductMapper {
    @Named("convertArticles")
    static Flux<Long> convertArticles(Flux<ArticleEntity> articles) {
        return articles.map(ArticleEntity::getId);
    }

    @Mapping(target = "implement_cost", source = "implementCost")
    @Mapping(target = "article_ids", source = "articles", qualifiedByName = "convertArticles")
    ProductDTO entityToDTO(Product src);
}
</code>```

Body:
I am writing a test REST API application on Spring webFlux and R2DBC. The problem is that the list of articles, which is attached to the product can not be formed before sending it to the client.

Current response:

{
    "id": 1,
    "name": "test1",
    "description": "test description",
    "implement_cost": 200.0,
    "article_ids": {
        "scanAvailable": true,
        "prefetch": -1
    }
}

expected response:

{
    "id": 1,
    "name": "test1",
    "description": "test description",
    "implement_cost": 200.0,
    "article_ids": [
        1,
        2
    ]
}

How can I form sub-list for response?

Blocking operations are prohibited.

block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-tcp-nio-1 create array from flux

I have product with list of attached articles.

package ru.serov.distask.model;

import lombok.Data;
import reactor.core.publisher.Flux;
import ru.serov.distask.dao.repository.enity.ArticleEntity;

@Data
public class Product {
    private Long id;
    private String name;
    private String description;
    private Float implementCost;
    private Flux<ArticleEntity> articles;
}

public class ArticleEntity {
    @Id
    @Column(value = "id")
    private Long id;
    @Column(value = "product_id")
    private Long productId;
    @Column(value = "name")
    private String name;
    @Column(value = "content")
    private String content;
    @Column(value = "create_date")
    private LocalDate createDate;
}

To create a product, I make a separate request for articles to ReactiveCrudRepository:

package ru.serov.distask.dao.repository;

import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import ru.serov.distask.dao.repository.enity.ArticleEntity;

public interface IArticleEntityRepo extends ReactiveCrudRepository<ArticleEntity, Long> {

    @Query(value = "DELETE FROM company.articles WHERE product_id = $1")
    Mono<Void> deleteArticlesByProductId(Long productId);

    @Query(value = "SELECT * FROM company.articles WHERE  product_id = $1")
    Flux<ArticleEntity> findAllByProductId(Long productId);
}

after that I use the service to form the product. I use MapStruct as map auto-generator.

@Override
public Mono<Product> getProductById(Long id) {
    return productEntityService
            .getProductById(id)
            .flatMap(product -> articleEntityService
                    .getArticlesByProductId(id)
                    .collectList()
                    .map(articles -> mapper.entityToProduct(product, Flux.fromIterable(articles))));

}

Product RESTcontroller

@GetMapping("/{id}")
Mono<ArticleDTO> getArticleById(@PathVariable Long id) {
    return articleService
            .getArticleById(id)
            .flatMap(article -> Mono.just(articleMapper.entityToDTO(article)));
}

Mapper to ArticleDTO

@Mapper(componentModel = "spring")
public interface IProductDTOProductMapper {
    @Named("convertArticles")
    static Flux<Long> convertArticles(Flux<ArticleEntity> articles) {
        return articles.map(ArticleEntity::getId);
    }

    @Mapping(target = "implement_cost", source = "implementCost")
    @Mapping(target = "article_ids", source = "articles", qualifiedByName = "convertArticles")
    ProductDTO entityToDTO(Product src);
}


问:
Getting a Blazor WebAssembly error - InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true
Please can someone explain what this error means and how to resolve it in my Blazor WebAssembly app?

```<code>InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.
</code>```

Controller code:

```<code>[HttpGet]
[Route("LoadDocumentation")]
public void LoadDocumentation()
{
    try
    {
        MessageDocumentationLibrary.DefaultLibrary.LoadDocumentation(new AssemblyName("Mainframe.Common"));
        MessageDocumentationLibrary.DefaultLibrary.LoadDocumentation(new AssemblyName("Mainframe.Messages"));
    }
    catch (ReflectionTypeLoadException ex)
    {
        throw new AggregateException(ex.LoaderExceptions);
    }
}

[HttpGet]
public IEnumerable<MessageDocumentation> Get()
{
    try
    {
        var records = MessageDocumentationLibrary.DefaultLibrary.GetDocumentationInOrder();
        return records.ToList();
    }
    catch (Exception e)
    {
        Console.WriteLine(e);
        throw;
    }
}
</code>```

Documentation.razor:

```<code>@page "/documentation"
@using Common.Documentation
@inject HttpClient Http

<PageTitle>Documentation</PageTitle>

<h1>Documentation</h1>

<p>This component demonstrates fetching data from the server.</p>

@if (forecasts == null)
{
    <p><em>Loading...</em></p>
}
else
{
    <table class="table">
        <thead>
            <tr>
                <th>Date</th>
                <th>Temp. (C)</th>
                <th>Temp. (F)</th>
                <th>Summary</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var forecast in forecasts)
            {
                <tr>
                    <td>@forecast.Description</td>
                    <td>@forecast.MessageId</td>
                </tr>
            }
        </tbody>
    </table>
}

@code {
    private List<MessageDocumentation> forecasts;

    protected override async Task OnInitializedAsync()
    {
        forecasts = await Http.GetFromJsonAsync<List<MessageDocumentation>>("Documentation");
    }
}
</code>```

Body:
Please can someone explain what this error means and how to resolve it in my Blazor WebAssembly app?

InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.

Controller code:

[HttpGet]
[Route("LoadDocumentation")]
public void LoadDocumentation()
{
    try
    {
        MessageDocumentationLibrary.DefaultLibrary.LoadDocumentation(new AssemblyName("Mainframe.Common"));
        MessageDocumentationLibrary.DefaultLibrary.LoadDocumentation(new AssemblyName("Mainframe.Messages"));
    }
    catch (ReflectionTypeLoadException ex)
    {
        throw new AggregateException(ex.LoaderExceptions);
    }
}

[HttpGet]
public IEnumerable<MessageDocumentation> Get()
{
    try
    {
        var records = MessageDocumentationLibrary.DefaultLibrary.GetDocumentationInOrder();
        return records.ToList();
    }
    catch (Exception e)
    {
        Console.WriteLine(e);
        throw;
    }
}

Documentation.razor:

@page "/documentation"
@using Common.Documentation
@inject HttpClient Http

<PageTitle>Documentation</PageTitle>

Documentation

This component demonstrates fetching data from the server.

@if (forecasts == null)
{

Loading...

}
else
{

                Date
                Temp. (C)
                Temp. (F)
                Summary

            @foreach (var forecast in forecasts)
            {

                    @forecast.Description
                    @forecast.MessageId

            }

}

@code {
    private List<MessageDocumentation> forecasts;

    protected override async Task OnInitializedAsync()
    {
        forecasts = await Http.GetFromJsonAsync<List<MessageDocumentation>>("Documentation");
    }
}


问:
Why use "and" in a for loop and "or" in a while loop for obtaining the same result...?
Why use "and" in a for loop and "or" in a while loop for obtaining the same result...?

Why use "and" in a for loop and "or" in a while loop for obtaining the same result...?


问:
Is there a more elegant way to apply complicated functions to meshgrid?
My goal is to plot the function $f(x,y) = 3^{\min\{x,2\}}t_0 y$
where $t_0$
is the smallest solution of $2t^x-3t-1=0$ (it's just a MWE; I didn't check the existence of the root(s). )

I did it. But in somehow an ugly way.

My approach is to apply the function element-wise. Here is my code:

import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fsolve

def equ(t,*data):   # 2t^x - 3t -1
    x = data
    return 2*(t ** x) - 3*t - 1

def t0(t):  # call fslove to solve the equation
    return fsolve(equ, 1.5, args=(t))[0] # 1.5 is randomly choosed

xx = np.linspace(1,3,50)    # range of x
yy = np.linspace(1,3,50)    # range of y
ff = [] # the value of f at each (x, y)

# compute the value of f element-wise
for x in xx:
    for y in yy:
        f = (3 ** np.minimum(x, 2)) * t0(x) * y
        ff.append(f)

fv = np.split(np.array(ff), np.size(xx)) # split ff to make it conform with meshgrid
xv, yv = np.meshgrid(xx, yy)

plt.pcolormesh(xv, yv, fv)
plt.colorbar()
plt.show()

```

But I think the elegancy of numpy is to avoid writing loops manually and to manipulate lists as a whole. So, is there a more elegant way to do that?

Body:
My goal is to plot the function $f(x,y) = 3^{\min\{x,2\}}t_0 y$
where $t_0$
is the smallest solution of $2t^x-3t-1=0$ (it's just a MWE; I didn't check the existence of the root(s). )

I did it. But in somehow an ugly way.

My approach is to apply the function element-wise. Here is my code:

import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import fsolve

def equ(t,*data):   # 2t^x - 3t -1
    x = data
    return 2*(t ** x) - 3*t - 1

def t0(t):  # call fslove to solve the equation
    return fsolve(equ, 1.5, args=(t))[0] # 1.5 is randomly choosed

xx = np.linspace(1,3,50)    # range of x
yy = np.linspace(1,3,50)    # range of y
ff = [] # the value of f at each (x, y)

# compute the value of f element-wise
for x in xx:
    for y in yy:
        f = (3 ** np.minimum(x, 2)) * t0(x) * y
        ff.append(f)

fv = np.split(np.array(ff), np.size(xx)) # split ff to make it conform with meshgrid
xv, yv = np.meshgrid(xx, yy)

plt.pcolormesh(xv, yv, fv)
plt.colorbar()
plt.show()

But I think the elegancy of numpy is to avoid writing loops manually and to manipulate lists as a whole. So, is there a more elegant way to do that?


问:
React prevent add if exists
I'm making a small project in react, and I have teams and meetings.
I need to prevent add of a new meeting to a certain team if this team has a meeting at that time.
How can I do that?
Also, how is it possible to block past dates with this input type?
Thank you!</p>
```<code>function Insert(): JSX.Element {

const navigate = useNavigate();

const [teams, setTeams] = useState<TeamModel[]>([]);

const { register, handleSubmit } = useForm<MeetingModel>();

useEffect(() => {
    meetingsService.getAllTeams()
        .then(teams => setTeams(teams))
        .catch(err => alert(err.message));
}, []);

async function send(meeting: MeetingModel) {
    try {
        await meetingsService.addMeeting(meeting);
        alert("Meeting has been added");
        navigate("/meetings");
    }
    catch (err: any) {
        alert(err.message);
    }
}
return (
    <div className="Insert">
        <h2>Add Meeting</h2>

        <img src={teamImage} alt="Team work" />

        <form onSubmit={handleSubmit(send)}>

            <label>Select Team: </label>
            <select defaultValue="" {...register("teamId")} required>
                <option disabled value="">
                    Select Team
                </option>
                {teams.map(t => <option key={t.teamId} value={t.teamId}>{t.teamName}</option>)}
            </select>

            <label>Start of meeting:</label>
            <input type="datetime-local" {...register("meetingStart")} required />

            <label>End of meeting: </label>
            <input type="datetime-local" {...register("meetingEnd")} required />

            <label>Description: </label>
            <input type="text" {...register("description")} required min="1" max="100" />

            <label>Meeting room: </label>
            <input type="text" {...register("meetingRoom")} required min="1" max="100" />

            <button>Add</button>
        </form>

    </div>
);
</code>```

Title: React prevent add if exists

Body:
I'm making a small project in react, and I have teams and meetings.
I need to prevent add of a new meeting to a certain team if this team has a meeting at that time.
How can I do that?
Also, how is it possible to block past dates with this input type?
Thank you!

function Insert(): JSX.Element {

const navigate = useNavigate();

const [teams, setTeams] = useState<TeamModel[]>([]);

const { register, handleSubmit } = useForm<MeetingModel>();

useEffect(() => {
    meetingsService.getAllTeams()
        .then(teams => setTeams(teams))
        .catch(err => alert(err.message));
}, []);

async function send(meeting: MeetingModel) {
    try {
        await meetingsService.addMeeting(meeting);
        alert("Meeting has been added");
        navigate("/meetings");
    }
    catch (err: any) {
        alert(err.message);
    }
}
return (

Add Meeting

        <form onSubmit={handleSubmit(send)}>

            Select Team:
            <select defaultValue="" {...register("teamId")} required>
                <option disabled value="">
                    Select Team
                </option>
                {teams.map(t => <option key={t.teamId} value={t.teamId}>{t.teamName}</option>)}
            </select>

            Start of meeting:
            <input type="datetime-local" {...register("meetingStart")} required />

            End of meeting:
            <input type="datetime-local" {...register("meetingEnd")} required />

            Description:
            <input type="text" {...register("description")} required min="1" max="100" />

            Meeting room:
            <input type="text" {...register("meetingRoom")} required min="1" max="100" />

            <button>Add</button>
        </form>

);


问:
Flutter :FileSystemException: Directory listing failed, path = '/storage/emulated/0/Android/data' (OS Error: Permission denied, errno = 13)
i am getting all pdf from device storage but after android 9 it mbile shows different eroors and all are same like exclude path = '/storage/emulated/0/Android/data . So how can i exclude all those path that create run time error</p>


问:
How to morph three.js on click
I’m extremely new to threejs and have been teaching myself everything this far. But I have a question I can’t seem to find the answer to. I have two click eventListeners that change my perlin noise from one shape to another. It works flawlessly but when you do click it’s an instant change to the other one. I’m trying to figure out how instead of having an immediate and jarring change, to instead morph the first one into the next one gradually so it looks smooth and nice.

Please any help would be so awesome. If someone can please explain how I would rewrite my current code to work for my project. Thanks again!!!

Currently here is what my listeners look like…

`

```<code>window.addEventListener("touchstart",function(e){
                config.shader.time = 0.01;
        config.shader.u_noise = 0.33;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 3.0;
                config.shader.waves = 10;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });
            addEventListener("touchend",function(e){
                config.shader.time = 0.17;
                config.shader.u_noise = 0.91;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 5.0;
                config.shader.waves = 1.64;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });

            window.addEventListener("mousedown", function(event){
            config.shader.time = 0.01;
        config.shader.u_noise = 0.33;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 3.0;
                config.shader.waves = 10;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });

        window.addEventListener("mouseup", function(event){
            config.shader.time = 0.17;
                config.shader.u_noise = 0.91;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 5.0;
                config.shader.waves = 1.64;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });
</code>```

`

I’m also using this codepen to make my project

text

Title: How to morph three.js on click

Body:
I’m extremely new to threejs and have been teaching myself everything this far. But I have a question I can’t seem to find the answer to. I have two click eventListeners that change my perlin noise from one shape to another. It works flawlessly but when you do click it’s an instant change to the other one. I’m trying to figure out how instead of having an immediate and jarring change, to instead morph the first one into the next one gradually so it looks smooth and nice.

Please any help would be so awesome. If someone can please explain how I would rewrite my current code to work for my project. Thanks again!!!

Currently here is what my listeners look like…

`

window.addEventListener("touchstart",function(e){
                config.shader.time = 0.01;
        config.shader.u_noise = 0.33;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 3.0;
                config.shader.waves = 10;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });
            addEventListener("touchend",function(e){
                config.shader.time = 0.17;
                config.shader.u_noise = 0.91;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 5.0;
                config.shader.waves = 1.64;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });

            window.addEventListener("mousedown", function(event){
            config.shader.time = 0.01;
        config.shader.u_noise = 0.33;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 3.0;
                config.shader.waves = 10;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });

        window.addEventListener("mouseup", function(event){
            config.shader.time = 0.17;
                config.shader.u_noise = 0.91;
                config.shader.decay = 0.86;
                config.shader.turb = 0.20;
                config.shader.scale = 5.0;
                config.shader.waves = 1.64;
                //config.shader.size = 1.0;
                config.shader.displ = 0.0;
                config.shader.broken = true;
                config.shader.invert = true;
                config.shader.color = 5.0;
                config.shader.complex = 0.1;
                pn.refresh();
            });

`

I’m also using this codepen to make my project

text


问:
Inability to send mail from a server with a poor reputation score
There is a website at x ip address and dozens of e-mail addresses. We are using plesk panel with windows server and IIS. Some private companies (such as banks) do not receive our mails at all because the reputation value is poor on this ip address, but 2-3 different blacklist checks do not show "blocked" anywhere.

Check web address; https://talosintelligence.com/reputation_center/lookup?search=80.01.01.01 (example ip: 80.01.01.01)

Do we have a chance to revise or update (to remove poor) for this ip address? Or will it be efficient to do the output ip address of the mails on the mailenable application via the y ip address that we will add to the server?

Updating the poor weakness rating or adding new ip to the server


问:
Predicting from a Converted XGboost Model to Daal4py RuntimeError: Could not convert Python object to oneDAL table
I have an XGBoost model trained using the Scikit XGBoostRegressor API. It is a binary classification problem. Now, I want to convert it to daal format for faster inference but I keep getting RuntimeError: Could not convert Python object to oneDAL table.

Here is my code

```<code>with open(r'xgboost-model', 'rb') as input_file:
    model = pickle.load(input_file)

import daal4py as d4p
daal_model = d4p.get_gbt_model_from_xgboost(model.get_booster())

predict = d4p.gbt_classification_prediction(2).compute(test2, daal_model).prediction
</code>```

and I get..

```<code>---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In [13], line 1
----> 1 prediction = d4p.gbt_classification_prediction(2).compute(test2, daal_model).prediction

File build/daal4py_cy.pyx:12628, in daal4py._daal4py.gbt_classification_prediction.compute()

File build/daal4py_cy.pyx:246, in daal4py._daal4py._execute_with_context.exec_func()

File build/daal4py_cy.pyx:12611, in daal4py._daal4py.gbt_classification_prediction._compute()

RuntimeError: Could not convert Python object to oneDAL table.
</code>```

Body:
I have an XGBoost model trained using the Scikit XGBoostRegressor API. It is a binary classification problem. Now, I want to convert it to daal format for faster inference but I keep getting RuntimeError: Could not convert Python object to oneDAL table.

Here is my code

with open(r'xgboost-model', 'rb') as input_file:
    model = pickle.load(input_file)

import daal4py as d4p
daal_model = d4p.get_gbt_model_from_xgboost(model.get_booster())

predict = d4p.gbt_classification_prediction(2).compute(test2, daal_model).prediction

and I get..

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In [13], line 1
----> 1 prediction = d4p.gbt_classification_prediction(2).compute(test2, daal_model).prediction

File build/daal4py_cy.pyx:12628, in daal4py._daal4py.gbt_classification_prediction.compute()

File build/daal4py_cy.pyx:246, in daal4py._daal4py._execute_with_context.exec_func()

File build/daal4py_cy.pyx:12611, in daal4py._daal4py.gbt_classification_prediction._compute()

RuntimeError: Could not convert Python object to oneDAL table.


问:
Meaning of `$` in AJAX functions
new to working with AJAX functions. I've ran into the following code in research in the frontend of an example allowing for messaging between users (this is from an online book on Node.js).

The below code gives the frontend for an application allowing for user messaging. What's important is that we're trying to create a long poll channel of communication between the client and the server.

```<code>// Client code
var counter = 0;
var poll = function() {
  $.getJSON('/poll/'+counter, function(response) {
     counter = response.count;
     var elem = $('#output');
     elem.text(elem.text() + response.append);
     poll();
  });
}
poll();
</code>```

My question - what's the meaning of $ here? It's used in a couple of different cases, firstly in $.getJSON and later in $('#output') and I'm not sure what it means in either of the cases. Any insight in either case is really appreciated.

Some research on ajax functions. I see their functionality but not the specifics of the syntax, particularly in that it feels like $ is used in different ways across the code.

Title: Meaning of `$` in AJAX functions

Body:
new to working with AJAX functions. I've ran into the following code in research in the frontend of an example allowing for messaging between users (this is from an online book on Node.js).

The below code gives the frontend for an application allowing for user messaging. What's important is that we're trying to create a long poll channel of communication between the client and the server.

// Client code
var counter = 0;
var poll = function() {
  $.getJSON('/poll/'+counter, function(response) {
     counter = response.count;
     var elem = $('#output');
     elem.text(elem.text() + response.append);
     poll();
  });
}
poll();

My question - what's the meaning of $ here? It's used in a couple of different cases, firstly in $.getJSON and later in $('#output') and I'm not sure what it means in either of the cases. Any insight in either case is really appreciated.

Some research on ajax functions. I see their functionality but not the specifics of the syntax, particularly in that it feels like $ is used in different ways across the code.


问:
laravel get json data group by
I have a table called Gallery and depending on the language column in this table, I want to group by language column Is it possible to do this, if possible can you give an example?

id
title
language

1
Apple
"[{"name":"Turkish","slug":"tr"},{"name":"Arabic","slug":"ar"}]"

2
Banana
"[{"name":"English","slug":"en"},{"name":"Arabic","slug":"ar"}]"

3
Home
"[{"name":"English","slug":"en"},{"name":"Turkish","slug":"tr"},]"

4
About
"[{"name":"English","slug":"en"}]"

5
Phone
"[{"name":"Arabic","slug":"ar"}]"

6
Tablet
"[{"name":"Turkish","slug":"tr"},{"name":"Arabic","slug":"ar"}]"

Title: laravel get json data group by


问:
Schema-validation: missing table when upgrading to spring-boot-3 (Hibernate 6 )
Background:

I have upgraded my spring boot project from '2.5.12' to '3.0.0'.

As part of the upgrade hibernate was also updated to 6.1.5.

All the java entities are now using jakarta.persistence instead of javax.persistence
as required

The issue:

When the application starts an error is thrown

```<code>Schema-validation: missing table ...
</code>```

The error is thrown from org.hibernate.tool.schema.internal.AbstractSchemaValidator

The function validateTable meant to validate that the entities match the DB tables.

```<code>    @Override
protected void validateTables(
        Metadata metadata,
        DatabaseInformation databaseInformation,
        ExecutionOptions options,
        ContributableMatcher contributableInclusionFilter,
        Dialect dialect, Namespace namespace) {

    final NameSpaceTablesInformation tables = databaseInformation.getTablesInformation( namespace );
    for ( Table table : namespace.getTables() ) {
        if ( options.getSchemaFilter().includeTable( table )
                && table.isPhysicalTable()
                && contributableInclusionFilter.matches( table ) ) {
            validateTable(
                    table,
                    tables.getTableInformation( table ),
                    metadata,
                    options,
                    dialect
            );
        }
    }
}
</code>```

Additional info:

The DB tables exist, i can log in and see them.

The databaseInformation.getTablesInformation( namespace ); returns empty results.

The namespace.getTables() shows all the tables correctly.

Hibernate generated classes are created O.K as part of the build (so annotations seem to be working).

Using MySQLDialect

Entities didn't change beside using jakarta.persistence

I don't get any "Connection refused " so connection to the DB is created.

The question:

Any idea what might be the cause?

Is there an issue with the model or reading schema data from the DB?

Might this be an issue of some dependency incompatibility?

Body:
Background:

I have upgraded my spring boot project from '2.5.12' to '3.0.0'.

As part of the upgrade hibernate was also updated to 6.1.5.

All the java entities are now using jakarta.persistence instead of javax.persistence
as required

The issue:

When the application starts an error is thrown

Schema-validation: missing table ...

The error is thrown from org.hibernate.tool.schema.internal.AbstractSchemaValidator

The function validateTable meant to validate that the entities match the DB tables.

    @Override
protected void validateTables(
        Metadata metadata,
        DatabaseInformation databaseInformation,
        ExecutionOptions options,
        ContributableMatcher contributableInclusionFilter,
        Dialect dialect, Namespace namespace) {

    final NameSpaceTablesInformation tables = databaseInformation.getTablesInformation( namespace );
    for ( Table table : namespace.getTables() ) {
        if ( options.getSchemaFilter().includeTable( table )
                && table.isPhysicalTable()
                && contributableInclusionFilter.matches( table ) ) {
            validateTable(
                    table,
                    tables.getTableInformation( table ),
                    metadata,
                    options,
                    dialect
            );
        }
    }
}

Additional info:

The DB tables exist, i can log in and see them.

The databaseInformation.getTablesInformation( namespace ); returns empty results.

The namespace.getTables() shows all the tables correctly.

Hibernate generated classes are created O.K as part of the build (so annotations seem to be working).

Using MySQLDialect

Entities didn't change beside using jakarta.persistence

I don't get any "Connection refused " so connection to the DB is created.

The question:

Any idea what might be the cause?

Is there an issue with the model or reading schema data from the DB?

Might this be an issue of some dependency incompatibility?


问:
Multi Tenancy in .NET 6 using Keycloak without restarting .NET application
I am trying to achieve multi tenancy in .NET 6 application for authorizing backend APIs.
I successfully achieve by adding multiple realms information (Issuer & Audience) in appSettings.json and jwt schemas inside program.cs file.
But my problem is, I want to achieve same multi tenancy when .NET application is in running state, because I don't want to restart application (production) when ever new realm created inside Keycloak.

I tried to inject newly created realm information into JWT Schema through ServiceCollection but unable to run it, because I am not allowing to inject new service during runtime of application.

I also tried to achieve it through middleware, I was able to add new middleware on runtime which is having schema of newly created realm, but it is still unable to identify schema.

Is there anyway to add multi tenancy support without rebuilding application?


问:
How to specify 2 learning rate schedulers for 1 optimizer in PyTorch Lightning?
I am using PyTorch Lightning to train a model and am just wondering how I can return 2 learning rate schedulers for 1 optimizer in def configure_optimizers? Below is my code draft:

```<code>def configure_optimizers(self):
        optimizer = torch.optim.Adam(self.parameters(), lr=self.learning_rate)

        scheduler1 = torch.optim.lr_scheduler.ExponentialLR(optimizer, gamma=0.95)
        scheduler2 = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer=optimizer, factor=0.2,
                                                                    patience=3,
                                                                    mode=self.monitor_mode,
                                                                    threshold=0.0001, cooldown=0, min_lr=0)

        return (
            {"optimizer": optimizer, "lr_scheduler": scheduler1},
            {
                "optimizer": optimizer,
                "lr_scheduler": {
                    "scheduler": scheduler2,
                    "monitor": "val_loss",
                },
            },
        )
</code>```

It seems that the return format is not quite right, the code returned this error:opt_idx set inside scheduler config does not match with the index of the respective optimizer returned from configure_optimizers.

Could I know how the code needs to be modified to achieve this?

Thanks!

Body:
I am using PyTorch Lightning to train a model and am just wondering how I can return 2 learning rate schedulers for 1 optimizer in def configure_optimizers? Below is my code draft:

def configure_optimizers(self):
        optimizer = torch.optim.Adam(self.parameters(), lr=self.learning_rate)

        scheduler1 = torch.optim.lr_scheduler.ExponentialLR(optimizer, gamma=0.95)
        scheduler2 = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer=optimizer, factor=0.2,
                                                                    patience=3,
                                                                    mode=self.monitor_mode,
                                                                    threshold=0.0001, cooldown=0, min_lr=0)

        return (
            {"optimizer": optimizer, "lr_scheduler": scheduler1},
            {
                "optimizer": optimizer,
                "lr_scheduler": {
                    "scheduler": scheduler2,
                    "monitor": "val_loss",
                },
            },
        )

It seems that the return format is not quite right, the code returned this error:opt_idx set inside scheduler config does not match with the index of the respective optimizer returned from configure_optimizers.

Could I know how the code needs to be modified to achieve this?

Thanks!


Title: Scipy odeint "The array return by func must be one-dimensional, but got ndim=3"

Body:
i want to solve a problem with an ODE of a system, but im running into a problem that odeint says my functions return a ndims object. now im confused since i dont know what i did wrong.

i have tried int(A[ 0 , 0 ]) for each elements. but it keeps returning a multidimensional array

Here's my code reduced to such but is able to run:

import numpy as np
import control
from scipy.integrate import odeint

#Now we write it in a numpy matrix with the following parameters:
k_1 = 1
k_2 = 1
k_3 = 1
k_4 = 1
k_5 = 1

m_x = 1
m_p = 1
m_y = 1

J = 1
r = 1

b_1 = 1
b_2 = 1

f_1 = 1
f_2 = 1

tau1 = 1
B_p = 1

A = np.matrix([[0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [(-4*k_1-f_1)/(m_x) , (-b_1)/(m_x) , 0 , 0 , (-k_1*r)/(m_x) , 0 , (-k_1*r)/(m_x) , 0 , (k_1*r)/(m_x) , 0 , (k_1*r)/(m_x) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ],
               [0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , (-2*k_2-2*k_5)/(4*m_p+m_x+m_y) , (-b_2-f_2)/(4*m_p+m_x+m_y) , k_2*r/(4*m_p+m_x+m_y) , 0 , k_2*r/(4*m_p+m_x+m_y) , 0 , k_5*r/(4*m_p+m_x+m_y) , 0 , -k_5*r/(4*m_p+m_x+m_y) , 0 , -k_5*r/(4*m_p+m_x+m_y) , 0 , -k_5*r/(4*m_p+m_x+m_y) , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [(-k_1*r)/(J) , 0 , (k_2*r)/(J) , 0 , (-k_1*r**2-k_2*r**2-tau1)/(J) , (-B_p)/(J) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [(-k_1*r)/(J) , 0 , (-k_2*r)/(J) , 0 , 0 , 0 , (-k_1*r**2-k_2*r**2-tau1)/(J) , (-B_p)/(J) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0  ],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [(k_1*r)/(J) , 0 , (k_5*r)/(J) , 0 , 0 , 0 , 0 , 0 , (-k_1*r**2-k_5*r**2-tau1)/(J) , (-B_p)/(J) , 0 , 0 , (k_5*r**2)/(J) , 0 , 0 , 0 , 0 , 0 , 0 , 0  ],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [(k_1*r)/(J) , 0 , (-k_5*r)/(J) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (-k_1*r**2-k_5*r**2-tau1)/(J) , (-B_p)/(J) , 0 , 0 , (k_5*r**2)/(J) , 0 , 0 , 0 , 0 , 0  ],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , (-k_5*r)/(J) , 0 , 0 , 0 , 0 , 0 , (k_5*r**2)/(J) , 0 , 0 , 0 , (-k_4*r**2-k_5*r**2-tau1)/(J) , (-B_p)/(J) , 0 , 0 , 0 , 0 , (k_4*r**2)/(J) , 0 ],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0],
               [0 , 0 , (k_5*r)/(J) , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (k_5*r**2)/(J) , 0 , 0 , 0 , (-k_4*r**2-k_5*r**2-tau1)/(J) , (-B_p)/(J) , (k_4*r**2)/(J) , 0 , 0 , 0  ],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (k_4*r**2)/(J) , 0 , (-k_3*r**2-k_4*r**2-tau1)/(J) , (-B_p)/(J) , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , (k_4*r**2)/(J) , 0 , 0 , 0 , 0 , 0 , (-k_3*r**2-k_4*r**2-tau1)/(J) , (-B_p)/(J)],])

B = np.matrix([[0, 0],
               [0, 0],
               [0, 0],
               [k_2*r, -k_2*r],
               [0, 0],
               [-k_2*r**2, 0],
               [0, 0],
               [0, -k_2*r**2],
               [0, 0],
               [0, 0],
               [0, 0],
               [0, 0],
               [0, 0],
               [0, 0],
               [0, 0],
               [0, 0],
               [0, 0],
               [k_3*r**2, 0],
               [0, 0],
               [0, k_3*r**2]])

# This Q matrix penalize the user for bad performance, we know its

Q1 = 1 #Penalize wrong position of x
Q2 = 1 #Penalize wrong position of xdot
Q3 = 1 #Penalize wrong position of y
Q4 = 1 #Penalize wrong position of ydot
Q5 = 1
Q6 = 1
Q7 = 1
Q8 = 1
Q9 = 1
Q10 = 1
Q11 = 1
Q12 = 1
Q13 = 1
Q14 = 1
Q15 = 1
Q16 = 1
Q17 = 1
Q18 = 1
Q19 = 1
Q20 = 1

Q = np.matrix([[Q1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , Q2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , Q3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , Q4 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , Q5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , Q6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , Q7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , Q8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q11 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q13 , 0 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q14 , 0 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q15 , 0 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q16 , 0 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q17 , 0 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q18 , 0 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q19 , 0],
               [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , Q20]])

R1 = 1
R2 = 1

R = np.matrix([[R1 , 0],
               [0 , R2 ]])

D = np.matrix([[0 , 0],
               [0 , 0 ]])
K, S, E = control.lqr(A, B, Q, R)

A = A-B*K

t = np.linspace(0, 10, 100)
#kondisi awal
S_0 = np.matrix([[0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0]])
#kondisi tujuan
u = np.matrix([[50], [0], [50], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0]])
u = -K*(S_0 - u)
M1 = u[0]
M2 = u[1]
S_0 = [0, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

def X(S,t,M1,M2,A,B):
#   X  Xdot Y Ydot  P3  P3D P4 P4D  P5  P5D  P6   P6D
    Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8, Z9, Z10, Z11, Z12, Z13, Z14, Z15, Z16, Z17, Z18, Z19, Z20 = S

    J = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    J[0] = A[ 0 , 0 ]*Z1 + A[ 0 , 1 ]*Z2 + A[ 0 , 2 ]*Z3 + A[ 0 , 3 ]*Z4 + A[ 0 , 4 ]*Z5 + A[ 0 , 5 ]*Z6 + A[ 0 , 6 ]*Z7 + A[ 0 , 7 ]*Z8 + A[ 0 , 8 ]*Z9 + A[ 0 , 9 ]*Z10 + A[ 0 , 10 ]*Z11 + A[ 0 , 11 ]*Z12 + A[ 0 , 12 ]*Z13 + A[ 0 , 13 ]*Z14 + A[ 0 , 14 ]*Z15 + A[ 0 , 15 ]*Z16 + A[ 0 , 16 ]*Z17 + A[ 0 , 17 ]*Z18 + A[ 0 , 18 ]*Z19 + A[ 0 , 19 ]*Z20 + B[ 0 , 0 ]*M1 + B[ 0 , 1 ]*M2,
    J[1] = A[ 1 , 0 ]*Z1 + A[ 1 , 1 ]*Z2 + A[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, 0 ]*Z1 + A[ 19 , 1 ]*Z2 + A[ 19 , 2 ]*Z3 + A[ 19 , 3 ]*Z4 + A[ 19 , 4 ]*Z5 + A[ 19 , 5 ]*Z6 + A[ 19 , 6 ]*Z7 + A[ 19 , 7 ]*Z8 + A[ 19 , 8 ]*Z9 + A[ 19 , 9 ]*Z10 + A[ 19 , 10 ]*Z11 + A[ 19 , 11 ]*Z12 + A[ 19 , 12 ]*Z13 + A[ 19 , 13 ]*Z14 + A[ 19 , 14 ]*Z15 + A[ 19 , 15 ]*Z16 + A[ 19 , 16 ]*Z17 + A[ 19 , 17 ]*Z18 + A[ 19 , 18 ]*Z19 + A[ 19 , 19 ]*Z20 + B[ 19 , 0 ]*M1 + B[ 19 , 1 ]*M2

    print(J)

    return J

X = odeint(func=X, y0=S_0, t=t,args=(M1,M2,A,B),full_output=True)

and here's my output and traceback call (the print output was from my debugging)

[(matrix([[0.]]),), (matrix([[0.]]),), (matrix([[0.]]),), (matrix([[73.30572786]]),), (matrix([[5.]]),), (matrix([[-39.25352255]]),), (matrix([[0.]]),), (matrix([[32.38553864]]),), (matrix([[0.]]),), (matrix([[5.]]),), (matrix([[0.]]),), (matrix([[-5.]]),), (matrix([[0.]]),), (matrix([[-5.]]),), (matrix([[0.]]),), (matrix([[5.]]),), (matrix([[0.]]),), (matrix([[39.25352255]]),), (matrix([[0.]]),), matrix([[-37.38553864]])]
Traceback (most recent call last):
  File "f:\Program\DynamicsAnalysis\test3.py", line 171, in <module>
    X = odeint(func=X, y0=S_0, t=t,args=(M1,M2,A,B),full_output=True)
  File "C:\Users\Richie Ryu\AppData\Local\Programs\Python\Python310\lib\site-packages\scipy\integrate\_odepack_py.py", line 241, in odeint
    output = _odepack.odeint(func, y0, t, args, Dfun, col_deriv, ml, mu,
RuntimeError: The array return by func must be one-dimensional, but got ndim=3.
PS F:\Program\DynamicsAnalysis>

I have tried making sure that A elements are integers by using int().
I have tried moving the matrix A and B used in the ODE to be inside the function.
I have tried reading and searching the web for the Traceback and well maybe my searching skill isnt up to par if the answer is out there