问:
How to parse custom scalars in graphql-codegen / apollo client?
The ethers.js library provides the BigNumber type. To create a BigNumber from a string we call BigNumber.from("42")

I have created aGraphQLScalar called GraphQLBignumber on my server:

import { GraphQLScalarType } from 'graphql';
import { BigNumber } from 'ethers';

const EthersBigNumberType = new GraphQLScalarType({
  name: 'BigNumber',
  description: 'A custom scalar type for representing ethers.js BigNumber values',
  parseValue(value: string | number | BigNumber) {
    return BigNumber.from(value);
  },
  serialize(value: BigNumber) {
    // Serialize the BigNumber instance into a string
    return value.toString();
  },
  parseLiteral(ast) {
    // Parse the ast value into a BigNumber instance
    if (ast.kind === Kind.STRING || ast.kind === Kind.INT || ast.kind === Kind.FLOAT) {
      return BigNumber.from(ast.value);
    }
    return null;
  },
});
```
<p>Now I would like to use this <code>BigNumber</code> scalar on my client using <code>graphql-codegen</code>. In my <code>codegen.yml</code> I add:</p>
<pre class="lang-yaml prettyprint-override"><code>plugins:
// other plugins incl typescript etc.
  - 'add':
      content: 'import {BigNumber} from "ethers"'
scalars:
  BigNumber: 'ethers.BigNumber'
</code>```

Now if I have the query:

```<code>  query GetBalance($address: String!) {
    balance(address: $address)
  }
</code>```

And I use codegen to generate the code, the output of GetBalanceQuery returns an ethers.BigNumber

When I use my application I am not getting any errors (so far) and everything seems to be working just fine.

My question is: How does my client application know how to convert the server response in to a ethers.BigNumber? As far as I can tell the client does not have a copy of the parseValue function yet the server is sending the BigNumber as a string so somewhere BigNumber.from(...) needs to be called...

Body:
The ethers.js library provides the BigNumber type. To create a BigNumber from a string we call BigNumber.from("42")

I have created aGraphQLScalar called GraphQLBignumber on my server:

import { GraphQLScalarType } from 'graphql';
import { BigNumber } from 'ethers';

const EthersBigNumberType = new GraphQLScalarType({
  name: 'BigNumber',
  description: 'A custom scalar type for representing ethers.js BigNumber values',
  parseValue(value: string | number | BigNumber) {
    return BigNumber.from(value);
  },
  serialize(value: BigNumber) {
    // Serialize the BigNumber instance into a string
    return value.toString();
  },
  parseLiteral(ast) {
    // Parse the ast value into a BigNumber instance
    if (ast.kind === Kind.STRING || ast.kind === Kind.INT || ast.kind === Kind.FLOAT) {
      return BigNumber.from(ast.value);
    }
    return null;
  },
});

Now I would like to use this BigNumber scalar on my client using graphql-codegen. In my codegen.yml I add:

plugins:
// other plugins incl typescript etc.
  - 'add':
      content: 'import {BigNumber} from "ethers"'
scalars:
  BigNumber: 'ethers.BigNumber'

Now if I have the query:

  query GetBalance($address: String!) {
    balance(address: $address)
  }

And I use codegen to generate the code, the output of GetBalanceQuery returns an ethers.BigNumber

When I use my application I am not getting any errors (so far) and everything seems to be working just fine.

My question is: How does my client application know how to convert the server response in to a ethers.BigNumber? As far as I can tell the client does not have a copy of the parseValue function yet the server is sending the BigNumber as a string so somewhere BigNumber.from(...) needs to be called...


来源: stackexchange

问:
Not sending multiple attachment in nodemailer
I tried to send multiple attachment using nodemailer. But It sends only the first attachment. Why is the second attachment not being sent? This is my mailOption  code segment.

```<code>  let mailOptions = {
    from: 'test@gmail.com',
    to: 'test@gmail.com',
    subject: 'Test',
    text: 'Email from nodemailer',
    attachments: [
      { filename: 'cv.pdf', path: './uploads/cv_uploads/cv.pdf' },
      { filename: 'cover.docx', path: './uploads/cover_uploads/cover.docx' },
    ],
  }
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I tried to send multiple attachment using nodemailer. But It sends only the first attachment. Why is the second attachment not being sent? This is my mailOption  code segment.

  let mailOptions = {
    from: 'test@gmail.com',
    to: 'test@gmail.com',
    subject: 'Test',
    text: 'Email from nodemailer',
    attachments: [
      { filename: 'cv.pdf', path: './uploads/cv_uploads/cv.pdf' },
      { filename: 'cover.docx', path: './uploads/cover_uploads/cover.docx' },
    ],
  }


问:
com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
I encountered the following error when trying to build an image in Jenkins. As part of the build, the docker maven plugin instructs it to build a docker image.

Please advise and thanks in advance.

Caused by: com.spotify.docker.client.exceptions.DockerException: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected

A part of the log is as follows:

```<code>[WARNING] An attempt failed, will retry 1 more times
org.apache.maven.plugin.MojoExecutionException: Could not build image
    at com.spotify.plugin.dockerfile.BuildMojo.buildImage (BuildMojo.java:234)
    at com.spotify.plugin.dockerfile.BuildMojo.execute (BuildMojo.java:129)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute (AbstractDockerMojo.java:265)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute (AbstractDockerMojo.java:254)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main (Maven35Launcher.java:130)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at jenkins.maven3.agent.Maven35Main.launch (Maven35Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at hudson.maven.Maven3Builder.call (Maven3Builder.java:139)
    at hudson.maven.Maven3Builder.call (Maven3Builder.java:70)
    at hudson.remoting.UserRequest.perform (UserRequest.java:212)
    at hudson.remoting.UserRequest.perform (UserRequest.java:54)
    at hudson.remoting.Request$2.run (Request.java:369)
    at hudson.remoting.InterceptingExecutorService$1.call (InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
Caused by: com.spotify.docker.client.exceptions.DockerException: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
    at com.spotify.docker.client.ProgressStream.hasNextMessage (ProgressStream.java:57)
    at com.spotify.docker.client.ProgressStream.tail (ProgressStream.java:73)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2734)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2718)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
Caused by: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
    at com.spotify.docker.client.shaded.org.apache.http.impl.io.ChunkedInputStream.getChunkSize (ChunkedInputStream.java:266)
    at com.spotify.docker.client.shaded.org.apache.http.impl.io.ChunkedInputStream.nextChunk (ChunkedInputStream.java:225)
    at com.spotify.docker.client.shaded.org.apache.http.impl.io.ChunkedInputStream.read (ChunkedInputStream.java:184)
    at com.spotify.docker.client.shaded.org.apache.http.conn.EofSensorInputStream.read (EofSensorInputStream.java:137)
    at java.io.BufferedInputStream.fill (BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read1 (BufferedInputStream.java:286)
    at java.io.BufferedInputStream.read (BufferedInputStream.java:345)
    at java.io.FilterInputStream.read (FilterInputStream.java:133)
    at java.io.FilterInputStream.read (FilterInputStream.java:133)
    at com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.EntityInputStream.read (EntityInputStream.java:102)
    at com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream.read (ReaderInterceptorExecutor.java:296)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._loadMore (UTF8StreamJsonParser.java:205)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._skipWSOrEnd2 (UTF8StreamJsonParser.java:2974)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._skipWSOrEnd (UTF8StreamJsonParser.java:2969)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken (UTF8StreamJsonParser.java:685)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.MappingIterator.hasNextValue (MappingIterator.java:240)
    at com.spotify.docker.client.ProgressStream.hasNextMessage (ProgressStream.java:53)
    at com.spotify.docker.client.ProgressStream.tail (ProgressStream.java:73)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2734)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2718)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)

...

[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.10:build (docker-mongodb) on project system-abc-fundamental: Could not build image: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :system-abc-fundamental
Set build name.
New build name is '#273 - origin/develop'
[Office365connector] No webhooks to notify
Finished: FAILURE
</code>```

How can I build images? Or anything I can check.
Note: I'm a newbie to this area.

Body:
I encountered the following error when trying to build an image in Jenkins. As part of the build, the docker maven plugin instructs it to build a docker image.

Please advise and thanks in advance.

Caused by: com.spotify.docker.client.exceptions.DockerException: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected

A part of the log is as follows:

[WARNING] An attempt failed, will retry 1 more times
org.apache.maven.plugin.MojoExecutionException: Could not build image
    at com.spotify.plugin.dockerfile.BuildMojo.buildImage (BuildMojo.java:234)
    at com.spotify.plugin.dockerfile.BuildMojo.execute (BuildMojo.java:129)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute (AbstractDockerMojo.java:265)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute (AbstractDockerMojo.java:254)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main (Maven35Launcher.java:130)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at jenkins.maven3.agent.Maven35Main.launch (Maven35Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at hudson.maven.Maven3Builder.call (Maven3Builder.java:139)
    at hudson.maven.Maven3Builder.call (Maven3Builder.java:70)
    at hudson.remoting.UserRequest.perform (UserRequest.java:212)
    at hudson.remoting.UserRequest.perform (UserRequest.java:54)
    at hudson.remoting.Request$2.run (Request.java:369)
    at hudson.remoting.InterceptingExecutorService$1.call (InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
Caused by: com.spotify.docker.client.exceptions.DockerException: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
    at com.spotify.docker.client.ProgressStream.hasNextMessage (ProgressStream.java:57)
    at com.spotify.docker.client.ProgressStream.tail (ProgressStream.java:73)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2734)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2718)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
Caused by: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected
    at com.spotify.docker.client.shaded.org.apache.http.impl.io.ChunkedInputStream.getChunkSize (ChunkedInputStream.java:266)
    at com.spotify.docker.client.shaded.org.apache.http.impl.io.ChunkedInputStream.nextChunk (ChunkedInputStream.java:225)
    at com.spotify.docker.client.shaded.org.apache.http.impl.io.ChunkedInputStream.read (ChunkedInputStream.java:184)
    at com.spotify.docker.client.shaded.org.apache.http.conn.EofSensorInputStream.read (EofSensorInputStream.java:137)
    at java.io.BufferedInputStream.fill (BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read1 (BufferedInputStream.java:286)
    at java.io.BufferedInputStream.read (BufferedInputStream.java:345)
    at java.io.FilterInputStream.read (FilterInputStream.java:133)
    at java.io.FilterInputStream.read (FilterInputStream.java:133)
    at com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.EntityInputStream.read (EntityInputStream.java:102)
    at com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream.read (ReaderInterceptorExecutor.java:296)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._loadMore (UTF8StreamJsonParser.java:205)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._skipWSOrEnd2 (UTF8StreamJsonParser.java:2974)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._skipWSOrEnd (UTF8StreamJsonParser.java:2969)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken (UTF8StreamJsonParser.java:685)
    at com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.MappingIterator.hasNextValue (MappingIterator.java:240)
    at com.spotify.docker.client.ProgressStream.hasNextMessage (ProgressStream.java:53)
    at com.spotify.docker.client.ProgressStream.tail (ProgressStream.java:73)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2734)
    at com.spotify.docker.client.DefaultDockerClient$ResponseTailReader.call (DefaultDockerClient.java:2718)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)

...

[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.10:build (docker-mongodb) on project system-abc-fundamental: Could not build image: com.spotify.docker.client.shaded.org.apache.http.ConnectionClosedException: Premature end of chunk coded message body: closing chunk expected -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :system-abc-fundamental
Set build name.
New build name is '#273 - origin/develop'
[Office365connector] No webhooks to notify
Finished: FAILURE

How can I build images? Or anything I can check.
Note: I'm a newbie to this area.


问:
how can I make (combine) this entity and this model
I want a single model instead of an entity and a model can somebody show me how to combine these two cause I still want to use uuid

at the end i want to have only the TodoModel and write the Todo entity in this MOdel class
my goal is to add an Equatable so that i can filter the object by Colors

this is the entity

```<code>
class Todo {
  final UniqueID id;
  final String title;
  final String body;
  final bool done;
  final TodoColor color;

  Todo(
      {required this.id,
      required this.body,
      required this.title,
      required this.color,
      required this.done});

  factory Todo.empty() {
    return Todo(
        id: UniqueID(),
        title: "",
        body: "",
        done: false,
        color: TodoColor(color: TodoColor.predefinedColors[5]));
  }

  Todo copyWith({
    UniqueID? id,
    String? title,
    String? body,
    bool? done,
    TodoColor? color,
  }) {
    return Todo(
      id: id ?? this.id,
      title: title ?? this.title,
      body: body ?? this.body,
     done: done ?? this.done,
      color: color ?? this.color,
    );
  }
}
</code>```

with this model

```<code>
class TodoModel {
  final String id;
  final String title;
  final String body;
  final bool done;
  final int color;
  final dynamic serverTimeStamp;

  TodoModel(
      {required this.id,
      required this.body,
      required this.title,
      required this.color,
      required this.done,
      required this.serverTimeStamp});

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'title': title,
      'body': body,
      'done': done,
      'color': color,
      'serverTimeStamp': serverTimeStamp,
    };
  }

  factory TodoModel.fromMap(Map<String, dynamic> map) {
    return TodoModel(
      id: "",
      title: map['title'] as String,
      body: map['body'] as String,
      done: map['done'] as bool,
      color: map['color'] as int,
      serverTimeStamp: map['serverTimeStamp'],
    );
  }

  TodoModel copyWith({
    String? id,
    String? title,
    String? body,
    bool? done,
    int? color,
    dynamic serverTimeStamp,
  }) {
    return TodoModel(
      id: id ?? this.id,
      title: title ?? this.title,
      body: body ?? this.body,
      done: done ?? this.done,
      color: color ?? this.color,
      serverTimeStamp: serverTimeStamp ?? this.serverTimeStamp,
    );
  }

  factory TodoModel.fromFirestore(
      QueryDocumentSnapshot<Map<String, dynamic>> doc) {
    return TodoModel.fromMap(doc.data()).copyWith(id: doc.id);
  }

  Todo toDomain() {
    return Todo(
        id: UniqueID.fromUniqueString(id),
        title: title,
        body: body,
        done: done,
        color: TodoColor(color: Color(color).withOpacity(1)));
  }

  factory TodoModel.fromDomain(Todo todoItem) {
    return TodoModel(
        id: todoItem.id.value,
        body: todoItem.body,
        title: todoItem.title,
        color: todoItem.color.color.value,
        done: todoItem.done,
        serverTimeStamp: FieldValue.serverTimestamp());
  }
}
</code>```

Body:
I want a single model instead of an entity and a model can somebody show me how to combine these two cause I still want to use uuid

at the end i want to have only the TodoModel and write the Todo entity in this MOdel class
my goal is to add an Equatable so that i can filter the object by Colors

this is the entity

class Todo {
  final UniqueID id;
  final String title;
  final String body;
  final bool done;
  final TodoColor color;

  Todo(
      {required this.id,
      required this.body,
      required this.title,
      required this.color,
      required this.done});

  factory Todo.empty() {
    return Todo(
        id: UniqueID(),
        title: "",
        body: "",
        done: false,
        color: TodoColor(color: TodoColor.predefinedColors[5]));
  }

  Todo copyWith({
    UniqueID? id,
    String? title,
    String? body,
    bool? done,
    TodoColor? color,
  }) {
    return Todo(
      id: id ?? this.id,
      title: title ?? this.title,
      body: body ?? this.body,
     done: done ?? this.done,
      color: color ?? this.color,
    );
  }
}

with this model

class TodoModel {
  final String id;
  final String title;
  final String body;
  final bool done;
  final int color;
  final dynamic serverTimeStamp;

  TodoModel(
      {required this.id,
      required this.body,
      required this.title,
      required this.color,
      required this.done,
      required this.serverTimeStamp});

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'title': title,
      'body': body,
      'done': done,
      'color': color,
      'serverTimeStamp': serverTimeStamp,
    };
  }

  factory TodoModel.fromMap(Map<String, dynamic> map) {
    return TodoModel(
      id: "",
      title: map['title'] as String,
      body: map['body'] as String,
      done: map['done'] as bool,
      color: map['color'] as int,
      serverTimeStamp: map['serverTimeStamp'],
    );
  }

  TodoModel copyWith({
    String? id,
    String? title,
    String? body,
    bool? done,
    int? color,
    dynamic serverTimeStamp,
  }) {
    return TodoModel(
      id: id ?? this.id,
      title: title ?? this.title,
      body: body ?? this.body,
      done: done ?? this.done,
      color: color ?? this.color,
      serverTimeStamp: serverTimeStamp ?? this.serverTimeStamp,
    );
  }

  factory TodoModel.fromFirestore(
      QueryDocumentSnapshot<Map<String, dynamic>> doc) {
    return TodoModel.fromMap(doc.data()).copyWith(id: doc.id);
  }

  Todo toDomain() {
    return Todo(
        id: UniqueID.fromUniqueString(id),
        title: title,
        body: body,
        done: done,
        color: TodoColor(color: Color(color).withOpacity(1)));
  }

  factory TodoModel.fromDomain(Todo todoItem) {
    return TodoModel(
        id: todoItem.id.value,
        body: todoItem.body,
        title: todoItem.title,
        color: todoItem.color.color.value,
        done: todoItem.done,
        serverTimeStamp: FieldValue.serverTimestamp());
  }
}


问:
How to match an array from one collection with a value in another?
I have two collections, which I then used the aggregate function to compare them and return the matching values. (commented out my attempt) I am trying to get both the values converted to upper value and then return another record from the other collection (Last_name) if the name and dbname value matches.</p>
```<code>Log.aggregate([
        {
            $addFields: {
                'First_name': {
                    $toUpper: '$First_name'
                },
            }
        },
        {
            $lookup: {
                from: 'db2',
                pipeline: [
                    { $addFields: { 'db_first_name': {$toUpper:   '$db_first_name'}}},
                    //{ $match: { $expr: { $ne: [ 'First_name', 'db_first_name' ] } } }

                ], as: 'Without_array',
            },
        },
        {
            $project: {
                lastname:
            {$arrayElemAt:['$Without_array.last_name',0]},
             // last_name is another record in the db2 collection the element of the array in this collection should match if 'First_name', 'db_first_name' match
                name: 1,
            }
        }
    ])
</code>```

Body:
I have two collections, which I then used the aggregate function to compare them and return the matching values. (commented out my attempt) I am trying to get both the values converted to upper value and then return another record from the other collection (Last_name) if the name and dbname value matches.

Log.aggregate([
        {
            $addFields: {
                'First_name': {
                    $toUpper: '$First_name'
                },
            }
        },
        {
            $lookup: {
                from: 'db2',
                pipeline: [
                    { $addFields: { 'db_first_name': {$toUpper:   '$db_first_name'}}},
                    //{ $match: { $expr: { $ne: [ 'First_name', 'db_first_name' ] } } }

                ], as: 'Without_array',
            },
        },
        {
            $project: {
                lastname:
            {$arrayElemAt:['$Without_array.last_name',0]},
             // last_name is another record in the db2 collection the element of the array in this collection should match if 'First_name', 'db_first_name' match
                name: 1,
            }
        }
    ])


问:
How to pload Image in Angular-editor and resize it?
I am using angular-editor and I want to upload image then check its size, the image will be uploaded from local desktop not from an API, so there is no uploadUrl in angular editor config

```<code>  editorConfig: AngularEditorConfig = {
        editable: true,
        spellcheck: true,
        height: 'auto',
        minHeight: '0',
        maxHeight: 'auto',
        width: 'auto',
        minWidth: '0',
        translate: 'yes',
        enableToolbar: true,
        showToolbar: true,
        placeholder: 'Enter text here...',
        defaultParagraphSeparator: '',
        defaultFontName: '',
        defaultFontSize: '',

        uploadWithCredentials: false,
        sanitize: false,
        toolbarPosition: 'top',
        upload: (file: File) => { //here I have to declare my function to check file size or resive it },

        toolbarHiddenButtons: [
            [
                'bold',
                'underline',
                'strikeThrough',
                'subscript',
                'superscript',
                'justifyFull',
                'indent',
                'outdent',
                'heading',
                'fontName',
            ],

            [
                'fontSize',
                'textColor',
                'backgroundColor',
                'customClasses',
                'link',
                'unlink',
                'insertVideo',
                'insertHorizontalRule',
                'removeFormat',
                'toggleEditorMode',
            ],
        ],
    };
</code>```

I create a new function uploadFile(file:File) and assign it to the upload function inside editorConfig. code :

```<code>uploadFile(file: File): Observable<HttpEvent<UploadResponse>> {
        console.log(file); // workes and display data correctly

        let reader = new FileReader(); // HTML5 FileReader API
        reader.readAsDataURL(file);
        let x = file;
        reader.onload = () => {

            return file;
        };

    }

</code>```

The problem in the console :
console

Body:
I am using angular-editor and I want to upload image then check its size, the image will be uploaded from local desktop not from an API, so there is no uploadUrl in angular editor config

  editorConfig: AngularEditorConfig = {
        editable: true,
        spellcheck: true,
        height: 'auto',
        minHeight: '0',
        maxHeight: 'auto',
        width: 'auto',
        minWidth: '0',
        translate: 'yes',
        enableToolbar: true,
        showToolbar: true,
        placeholder: 'Enter text here...',
        defaultParagraphSeparator: '',
        defaultFontName: '',
        defaultFontSize: '',

        uploadWithCredentials: false,
        sanitize: false,
        toolbarPosition: 'top',
        upload: (file: File) => { //here I have to declare my function to check file size or resive it },

        toolbarHiddenButtons: [
            [
                'bold',
                'underline',
                'strikeThrough',
                'subscript',
                'superscript',
                'justifyFull',
                'indent',
                'outdent',
                'heading',
                'fontName',
            ],

            [
                'fontSize',
                'textColor',
                'backgroundColor',
                'customClasses',
                'link',
                'unlink',
                'insertVideo',
                'insertHorizontalRule',
                'removeFormat',
                'toggleEditorMode',
            ],
        ],
    };

I create a new function uploadFile(file:File) and assign it to the upload function inside editorConfig. code :

uploadFile(file: File): Observable<HttpEvent<UploadResponse>> {
        console.log(file); // workes and display data correctly

        let reader = new FileReader(); // HTML5 FileReader API
        reader.readAsDataURL(file);
        let x = file;
        reader.onload = () => {

            return file;
        };

    }

The problem in the console :
console


问:
Angular post ImageData to Spring Backend and save as jpeg
I am currently trying to offer my users a possibility to choose, edit and upload an image. My ImageEditor (https://ej2.syncfusion.com/angular/demos/#/bootstrap5/image-editor/default) gives me the edited image as a  ImageData type.

I transformed the ImageData into a Base64 data string which contains my image.

I send this string as formdata via http post to my Backend where I try to receive it as a MultiPart File. But it is allways null.

Angular component:

```<code>  beforeSave(args: any): void {
    const imageEditor: ImageEditorComponent = getComponent(document.getElementById('image-editor')!, 'image-editor');

    args.cancel = true;

    // Custom save logic goes here
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    canvas.width = imageEditor.getImageData().width;
    canvas.height = imageEditor.getImageData().height;
    ctx!.putImageData(imageEditor.getImageData(), 0, 0);

    const image = new Image();
    image.src = canvas.toDataURL();

    this.learningContentService.saveImageInTempLocation(image.src,"temp", args.fileType).subscribe(res => console.warn(res))
</code>```

Angular service:

```<code>saveImageInTempLocation(image: any, imageName: string, imageFormat: string): Observable<HttpResponse<string>> {
    const formData = new FormData();
    formData.append('image', image);

    return this.http.post<string>(
      `${this.resourceUrl}/save-image?imageName=${imageName}&imageFormat=${imageFormat}`, formData,
      { observe: 'response' }
    );
  }
</code>```

Spring Controller

```<code>@PostMapping(path="/save-image",consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE,
        MediaType.MULTIPART_FORM_DATA_VALUE}, produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<String> saveImageForLearningContent(
        @RequestBody MultipartFile image
    ) throws IOException {
        ...
    }
</code>```

Body:
I am currently trying to offer my users a possibility to choose, edit and upload an image. My ImageEditor (https://ej2.syncfusion.com/angular/demos/#/bootstrap5/image-editor/default) gives me the edited image as a  ImageData type.

I transformed the ImageData into a Base64 data string which contains my image.

I send this string as formdata via http post to my Backend where I try to receive it as a MultiPart File. But it is allways null.

Angular component:

  beforeSave(args: any): void {
    const imageEditor: ImageEditorComponent = getComponent(document.getElementById('image-editor')!, 'image-editor');

    args.cancel = true;

    // Custom save logic goes here
    const canvas = document.createElement('canvas');
    const ctx = canvas.getContext('2d');
    canvas.width = imageEditor.getImageData().width;
    canvas.height = imageEditor.getImageData().height;
    ctx!.putImageData(imageEditor.getImageData(), 0, 0);

    const image = new Image();
    image.src = canvas.toDataURL();

    this.learningContentService.saveImageInTempLocation(image.src,"temp", args.fileType).subscribe(res => console.warn(res))

Angular service:

saveImageInTempLocation(image: any, imageName: string, imageFormat: string): Observable<HttpResponse<string>> {
    const formData = new FormData();
    formData.append('image', image);

    return this.http.post<string>(
      `${this.resourceUrl}/save-image?imageName=${imageName}&imageFormat=${imageFormat}`, formData,
      { observe: 'response' }
    );
  }

Spring Controller

@PostMapping(path="/save-image",consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE,
        MediaType.MULTIPART_FORM_DATA_VALUE}, produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<String> saveImageForLearningContent(
        @RequestBody MultipartFile image
    ) throws IOException {
        ...
    }


问:
Getting unsupported_operation_exception in elasticsearch when I use wildcard (*)
Below code was working in the elasticsearch 7.8 but it's throwing error after upgrade the elasticsearch server to 8.5. please have a look and let me know the solution.

```<code>{
  "query": {
    "bool": {
      "must":{
         "query_string": {
             "fields":["id","title","description"],
             "query":"*"
         }
      }
    }
  }
}
</code>```

ERROR MESSAGE:

"type":"unsupported_operation_exception"

"reason":"all shards failed"

"status":400

Body:
Below code was working in the elasticsearch 7.8 but it's throwing error after upgrade the elasticsearch server to 8.5. please have a look and let me know the solution.

{
  "query": {
    "bool": {
      "must":{
         "query_string": {
             "fields":["id","title","description"],
             "query":"*"
         }
      }
    }
  }
}

ERROR MESSAGE:

"type":"unsupported_operation_exception"

"reason":"all shards failed"

"status":400


问:
pycuda._driver.LogicError: cuModuleLoadDataEx failed: device kernel image is invalid
I want to run simple code in pycuda

```<code>import numpy as np
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule

mod = SourceModule("""
__global__ void doublify(float *a)
{
int idx = threadIdx.x + threadIdx.y*4;
a[idx] *= 2;
}
""",arch='sm_61')
</code>```

I have chosen arch='sm_61' because if I remove it this error appears:

nvcc fatal   : Value 'sm_86' is not defined for option
'gpu-architecture'

I have cuda 10.1 and cuda 11.2 and the default nvcc version is V10.1.
I don't want to remove any of them. (someone suggested this as a solution)

now I get this error:

pycuda._driver.LogicError: cuModuleLoadDataEx failed: device kernel
image is invalid -

how can I solve this issue?

The OS is windows 10.
pycuda 2022.2
Python 3.7.4
nvcc version: V10.1.105

I will change the pycuda version or python version if needed.

Body:
I want to run simple code in pycuda

import numpy as np
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule

mod = SourceModule("""
__global__ void doublify(float *a)
{
int idx = threadIdx.x + threadIdx.y*4;
a[idx] *= 2;
}
""",arch='sm_61')

I have chosen arch='sm_61' because if I remove it this error appears:

nvcc fatal   : Value 'sm_86' is not defined for option
'gpu-architecture'

I have cuda 10.1 and cuda 11.2 and the default nvcc version is V10.1.
I don't want to remove any of them. (someone suggested this as a solution)

now I get this error:

pycuda._driver.LogicError: cuModuleLoadDataEx failed: device kernel
image is invalid -

how can I solve this issue?

The OS is windows 10.
pycuda 2022.2
Python 3.7.4
nvcc version: V10.1.105

I will change the pycuda version or python version if needed.


问:
Passing event as props
I have a custom button component that I can reuse across the other page as a different button and still learning to use typescript. But when I tried to connect to Metamask, it doesnt prompt anything and I'm not sure on which part that need to be fixed

From my CustomButton.tsx

```<code>interface CustomButtonProps {
  btnType: string;
  title: string;
  styles: string;
  handleClick?: () => void;
}

const CustomButton = ({
  btnType,
  title,
  styles,
  handleClick,
}: CustomButtonProps) => {
  return (
    <button
      type={btnType}
      className={`font-epilogue font-semibold text-[16px] leading-[26px] text-white min-h-[52px] px-4 rounded-[10px] ${styles}`}
      onClick={handleClick}
    >
      {title}
    </button>
  );
};

</code>```

So I use this component in my Navbar as follows:

```<code>// usecontext to connect to the Metamask
import { useAccount } from "../context";
// custombuton component
import { CustomButton } from "./";

const Navbar = () => {

  const { connect, account } = useAccount();
 <div className="sm:flex hidden flex-row justify-end gap-4">
        <CustomButton
          btnType="button"
          title={account ? "Create a campaign" : "Connect"}
          styles={account ? "bg-[#1dc071]" : "bg-[#8c6dfd]"}
          handleClick={() => {
            if (account) <Link href="create-campaign" />;
            else return connect;
          }}
        />
</div>

</code>```

Title: Passing event as props

Body:
I have a custom button component that I can reuse across the other page as a different button and still learning to use typescript. But when I tried to connect to Metamask, it doesnt prompt anything and I'm not sure on which part that need to be fixed

From my CustomButton.tsx

interface CustomButtonProps {
  btnType: string;
  title: string;
  styles: string;
  handleClick?: () => void;
}

const CustomButton = ({
  btnType,
  title,
  styles,
  handleClick,
}: CustomButtonProps) => {
  return (
    <button
      type={btnType}
      className={`font-epilogue font-semibold text-[16px] leading-[26px] text-white min-h-[52px] px-4 rounded-[10px] ${styles}`}
      onClick={handleClick}
    >
      {title}
    </button>
  );
};

So I use this component in my Navbar as follows:

// usecontext to connect to the Metamask
import { useAccount } from "../context";
// custombuton component
import { CustomButton } from "./";

const Navbar = () => {

  const { connect, account } = useAccount();

        <CustomButton
          btnType="button"
          title={account ? "Create a campaign" : "Connect"}
          styles={account ? "bg-[#1dc071]" : "bg-[#8c6dfd]"}
          handleClick={() => {
            if (account) <Link href="create-campaign" />;
            else return connect;
          }}
        />


问:
Error 401 after successful NTLM authentication
I am trying to login into a site, which requires NTLM authentication, using HttpNtlmAuth from requests_ntlm. Here is the code. I have not shown actual url (url1) as it is from my company.

```<code>url1 = "http://url"
payload={"ref": "B72048061"}
header_data = {'User-agent':'Mozilla/5.0'}
auth = HttpNtlmAuth(User, Password)
r1 = requests.get(url1, params=payload, headers=header_data, auth=auth, proxies=proxies, verify=False)
r1
</code>```

I am getting below error.

```<code><Response [401]>
</code>```

Here are more details.

```<code>print(r1.url)
print(r1.headers)
print(r1.text)
</code>```

output

```<code>http://url?ref=B72048061
{'Date': 'Mon, 19 Dec 2022 11:55:05 GMT', 'Set-Cookie': 'SMSESSION=8WEKGZ5xQuxJ9Uefebxe+YIv6HDZhltVtmL9gdrSvmguTuaIH6zZ40TW9+y5ZSTQzEKJLpRta26Fj1txU2lHrnnU7F8GSuviGsLPrKoh0xtlxhkrdogKgOtFuaw9k2e9cusAWjtBE+as2i1Qd0D2cPRUGm/4fJez+itFVyAzJ0eP7pW/ggGyIFoZmU7XjgaqliRc9tuqU5SufXrEPztO4yZSEUgaXUz/ul6XK0NZ/QO211cCmxanYkmGHvCdAhT/z9p2V8Xq5wlRRvpgupVbuxgrvu+OQOANdhuLWOj+KZFiZmyyECKe0QQnK08tFiV7GbZUHNRMK+8lm/zYOkSm/w9NXtIluAIBEzuClzk1cmfesjxCmDXjHuZ90jtwQDxuSRwIcXzdZqvl4L6k8oBIPZVJD3QFAkmudxnXZTddHRFx+YaKvF2Yjhq8vmef+ucanEavekMktpoo9r226og31Zd6uV3C1mZT/8zcN4PVdoJR0XZMLSUKwxLh28EQjIkDX0RhXQkOkVaX3BAiMqubPqJsjlZDRVjNdIqa05qbLBmAG9tzNIv1PNzXltJ6/zptiy81Hms8W3IZrNQLbe8Ry2tAqCCbmkdP+KJ1N20OHGbcUiyyigW2YN24u3/JFx8XTEd4DkSpzFk/kVzBWw/zDlNAI3N0rMNcbfZ/MdXO54lLCa35+znwyb9fSxRt3n4tNCnfpaf6okIXJjYFoEZl/moICdXmEXXF+u3LJAWSc5hZM78S7kM4r0rrxz1qfZZSK0cVPCyc4KfAksnrIgq8ciCEZuieVcXiYbYic9d0B9XcOEArkDxoremnavk0RZAxisyaYR5UJcKtQTKfr5r2lzgEwD2mHIU8sjiDG0lNchlE05uJfYTrnas6oNOA1ZLuKHHRJ0kx8U6QSi4yHbuPeJ4Gubqbpiq/a8E6x5j00hwJl/ZDp8CB77HzhgWvACnYD8TrNwzEpjOYD70PyAq1QHeoUsmZVgggPHs0PtX05UhL+77aIVT/STdZCKj4ZdDbPHbTgz81vh9jfpR6lv6FXCWEWO/b+DxDsBuaPlDid36gVxCcvj4r8YnLIclWEVcznrZfulE2wTIB86Ckk+3lVnRw5FWPWLhvgdcbeiQFho7u8B6x4H7zTqWinCpvVH8mVEu6fPA7swECLMii+YrbC2v67Uyc1qdGj5+HO7qJYEcMMA2yI5ygaQK7kMYeeLOPj2U6Qw7ni4u989WFvV24ZdQE9TW6hMDWYz82MEnJkI7spDO3JKxfiMStYY1/TdaeVsGrc3KonDBwNPjfjn03zkI+kX+CtJML; path=/; domain=xxx.corp, SMCHALLENGE=YES; Path=/; Domain=xxx.corp, SMONDENIEDREDIR=NO; Expires=Thu, 01-Dec-94 16:00:00 GMT; Path=/; Domain=xxx.corp', 'X-Powered-By': 'Servlet/3.0', 'WWW-Authenticate': 'Basic realm="REP_F370_TAI-root [12:55:5:945] "', '$WSEP': '', 'Expires': 'Thu, 01 Dec 1994 16:00:00 GMT', 'Cache-Control': 'no-cache="set-cookie, set-cookie2"', 'X-OneAgent-JS-Injection': 'true', 'X-ruxit-JS-Agent': 'true', 'Server-Timing': 'dtSInfo;desc="0", dtRpid;desc="-521266895"', 'Keep-Alive': 'timeout=10, max=99', 'Connection': 'Keep-Alive', 'Transfer-Encoding': 'chunked', 'Content-Type': 'text/html;charset=ISO-8859-1', 'Content-Language': 'en-US'}
Error 401: ACCESS-DENIED
</code>```

Take a look into response history:

```<code>for resp in r1.history:
    print(resp.url)
    print(resp.text)
    print('Status Code:', resp.status_code)
    print(resp.headers)
    print('\n')
</code>```

Output:

```<code>http:////url?ref=B72048061
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://winssor12-vip.xxx.corp:443/siteminderagent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-9xex6NsJ4%2b587a54UsP5CW4QMeT35xwiKJoZua8FNdPb8Uvg%2bW%2fjUV2leieKYjCz&TARGET=-SM-HTTP%3a%2f%2fxxx--pdm--services%2eeu%2exxx%2ecorp%3a1080%2faps--web%2fP%2fview%2fO_IP%3fref%3dV92B72048061">here</a>.</p>
<hr>
<address>IBM_HTTP_Server at xxx-pdm-services.eu.xxx.corp Port 1080</address>
</body></html>

Status Code: 302
{'Date': 'Mon, 19 Dec 2022 12:25:06 GMT', 'Cache-Control': 'no-store', 'Location': 'https://winssor12-vip.xxx.corp:443/siteminderagent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-9xex6NsJ4%2b587a54UsP5CW4QMeT35xwiKJoZua8FNdPb8Uvg%2bW%2fjUV2leieKYjCz&TARGET=-SM-HTTP%3a%2f%2fxxx--pdm--services%2eeu%2exxx%2ecorp%3a1080%2faps--web%2fP%2fview%2fO_IP%3fref%3dV92B72048061', 'Server-Timing': 'dtSInfo;desc="0", dtRpid;desc="-139048060"', 'Set-Cookie': 'dtCookie=v_4_srv_9_sn_9A3A0571C2E35B5E0D7C5AB97C0604EB_perc_100000_ol_0_mul_1_app-3Afb71c72ef431f887_1; Path=/; Domain=.xxx.corp', 'Content-Length': '570', 'Keep-Alive': 'timeout=10, max=100', 'Connection': 'Keep-Alive', 'Content-Type': 'text/html; charset=iso-8859-1'}

https://winssor12-vip.xxx.corp:443/siteminderagent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-9xex6NsJ4%2b587a54UsP5CW4QMeT35xwiKJoZua8FNdPb8Uvg%2bW%2fjUV2leieKYjCz&TARGET=-SM-HTTP%3a%2f%2fxxx--pdm--services.eu.xxx.corp%3a1080%2faps--web%2fP%2fview%2fO_IP%3fref%3dB72048061

Status Code: 302
{'Via': 'proxy A', 'Date': 'Mon, 19 Dec 2022 12:25:06 GMT', 'Server': 'Microsoft-IIS/10.0', 'Location': 'HTTP://xxx-pdm-services.eu.xxx.corp:1080/aps-web/P/view/O_IP?ref=B72048061', 'Connection': 'Keep-Alive', 'set-cookie': 'SMCHALLENGE=NTC_CHALLENGE_DONE; path=/; domain=xxx.corp, SMSESSION=H5Ya4mHFxMf5o5wXubpUuiKrZM09+RY8Na0i+Q2kxE1aor1MQhybJlg4WgFLB5Iw8lRNFhr1qvPUElsa4g+M0obXRSvP6jt0XwQPQOHc6pnmhXYyDB6L2lAIrgccnPvZsFxYF6Cig+coLbE0DIDeWFuDXD47LXBRzTqY1KRwCOkX+oSuC0AdvhGoeIOljgthwm8KLvHEzVq9fvUSfJAPeRPOyoRRtt0JA6Vg4BgCvsiNT1KHV1/9UNugmWp668juLilZHM6ZJZZt5i//5zFMTlgxSH91z7PkQUzKBwHrxZ0BPXIC4dlVsirfaMgRcZ33T5Cj5jLuDWk628Ce3ps6JbxCopaxKiD5xQFxLGbkK0juKvqBPAlJqLG8Rvv3vEGuujPt0G8mGmysGjHBjIYup7xFzCfD4mDkB2haZAOJrIhEJ7NBERoeemak2XmeUfeM8WxdXlAAgZmcxhH5+04RovujA7Qwwv4LW22jO3nPVqBQi81sN+5faW/ZPgCXXZ4Pzd7icTri6yJYVT5SBcaMhXbxkfNwNSk7YgFrU+5BDj7rDJNjVCiGAiapEQjU+3GxrRc9Ql7Rf6+gKWEEcNrWKS68O70+0uZftnldkA8a5MmJuTQ0SyApSWMPIvICQvKzBRrhBPE5R1LWxZRZIQ3ysDhG92fg3s8Arau5dFwuFYFMvQXAAYgjSNZ4c114yfWOjcV2edtDRYH9SekqpX6QCxX0UBex0LeKjbrSmNiY2IPdmBOoxHHRA9KreHgebugh4wEX9Xrp+oUm9MjxhQee+/lqiAqcuh81crWYttu3LkaXkj0BUoRmm6rqhm3GuaSwQSAN35LpcStN/+IgEEYFsIswd1OiWNY6IfARN5nLpqQgupMhVa3G/kZpadSfDmt0/u+G07M1EjjpaJB2eoDCHeDBFVZAJhgNxtzj2Na6T0SE5JYmCSp1XdZj0oeOC33eDX1M9q9xDYOCHLhmcCcFP7KE5mi0Q3KZ7N//ws95uPTdgPwMdxxKVykNebdbEPQjMltN09Uj80ws5N4FRu/9Cyq+4L+jS0gEaZz0OIR4l0v4nhqWqtoq3s1pkTlGU8z52uJE1IKH7pO5gG5iz9+/HYpA1JIdQH/HuL2Nu6SOh14FTdrATU5Id9Ip9Wvyi62G/FgLXHh/BYHC9yxrZYQX0M3NYQSjCuDRtbhGLPKkmYvMSDl8ZGmjlLapRdaQn66J6ILPmLKnifoydT8FJizsAzVtdGhNo5yszH5iCK6Y0976oVWqYfIadT+I6RdBC+/iVVzxHYZEMxsDOLBKAKPLDR5tyK2hilM4; path=/; domain=airbus.corp', 'X-Powered-By': 'ASP.NET', 'Cache-Control': 'no-store', 'Content-Length': '0', 'Persistent-Auth': 'false'}
</code>```

So as can be seen in history, NTLM authentication was completed and is redirected back to required url1. However due to some issues, which I am not able to figure out, access is denied with error code 401 as can be seen above. Another thing which I noticed is that SMchallenge in response header set cookie is 'YES' and there exists SMONDENIEDREDIR. When I checked the form in browser network for succeful login, SMchallenge in set cookies remain 'No' and there exists nothing like SMONDENIEDREDIR. I am now wondering whether NTLM authentication was successful or not and how to solve this issue!

Body:
I am trying to login into a site, which requires NTLM authentication, using HttpNtlmAuth from requests_ntlm. Here is the code. I have not shown actual url (url1) as it is from my company.

url1 = "http://url"
payload={"ref": "B72048061"}
header_data = {'User-agent':'Mozilla/5.0'}
auth = HttpNtlmAuth(User, Password)
r1 = requests.get(url1, params=payload, headers=header_data, auth=auth, proxies=proxies, verify=False)
r1

I am getting below error.

<Response [401]>

Here are more details.

print(r1.url)
print(r1.headers)
print(r1.text)

output

http://url?ref=B72048061
{'Date': 'Mon, 19 Dec 2022 11:55:05 GMT', 'Set-Cookie': 'SMSESSION=8WEKGZ5xQuxJ9Uefebxe+YIv6HDZhltVtmL9gdrSvmguTuaIH6zZ40TW9+y5ZSTQzEKJLpRta26Fj1txU2lHrnnU7F8GSuviGsLPrKoh0xtlxhkrdogKgOtFuaw9k2e9cusAWjtBE+as2i1Qd0D2cPRUGm/4fJez+itFVyAzJ0eP7pW/ggGyIFoZmU7XjgaqliRc9tuqU5SufXrEPztO4yZSEUgaXUz/ul6XK0NZ/QO211cCmxanYkmGHvCdAhT/z9p2V8Xq5wlRRvpgupVbuxgrvu+OQOANdhuLWOj+KZFiZmyyECKe0QQnK08tFiV7GbZUHNRMK+8lm/zYOkSm/w9NXtIluAIBEzuClzk1cmfesjxCmDXjHuZ90jtwQDxuSRwIcXzdZqvl4L6k8oBIPZVJD3QFAkmudxnXZTddHRFx+YaKvF2Yjhq8vmef+ucanEavekMktpoo9r226og31Zd6uV3C1mZT/8zcN4PVdoJR0XZMLSUKwxLh28EQjIkDX0RhXQkOkVaX3BAiMqubPqJsjlZDRVjNdIqa05qbLBmAG9tzNIv1PNzXltJ6/zptiy81Hms8W3IZrNQLbe8Ry2tAqCCbmkdP+KJ1N20OHGbcUiyyigW2YN24u3/JFx8XTEd4DkSpzFk/kVzBWw/zDlNAI3N0rMNcbfZ/MdXO54lLCa35+znwyb9fSxRt3n4tNCnfpaf6okIXJjYFoEZl/moICdXmEXXF+u3LJAWSc5hZM78S7kM4r0rrxz1qfZZSK0cVPCyc4KfAksnrIgq8ciCEZuieVcXiYbYic9d0B9XcOEArkDxoremnavk0RZAxisyaYR5UJcKtQTKfr5r2lzgEwD2mHIU8sjiDG0lNchlE05uJfYTrnas6oNOA1ZLuKHHRJ0kx8U6QSi4yHbuPeJ4Gubqbpiq/a8E6x5j00hwJl/ZDp8CB77HzhgWvACnYD8TrNwzEpjOYD70PyAq1QHeoUsmZVgggPHs0PtX05UhL+77aIVT/STdZCKj4ZdDbPHbTgz81vh9jfpR6lv6FXCWEWO/b+DxDsBuaPlDid36gVxCcvj4r8YnLIclWEVcznrZfulE2wTIB86Ckk+3lVnRw5FWPWLhvgdcbeiQFho7u8B6x4H7zTqWinCpvVH8mVEu6fPA7swECLMii+YrbC2v67Uyc1qdGj5+HO7qJYEcMMA2yI5ygaQK7kMYeeLOPj2U6Qw7ni4u989WFvV24ZdQE9TW6hMDWYz82MEnJkI7spDO3JKxfiMStYY1/TdaeVsGrc3KonDBwNPjfjn03zkI+kX+CtJML; path=/; domain=xxx.corp, SMCHALLENGE=YES; Path=/; Domain=xxx.corp, SMONDENIEDREDIR=NO; Expires=Thu, 01-Dec-94 16:00:00 GMT; Path=/; Domain=xxx.corp', 'X-Powered-By': 'Servlet/3.0', 'WWW-Authenticate': 'Basic realm="REP_F370_TAI-root [12:55:5:945] "', '$WSEP': '', 'Expires': 'Thu, 01 Dec 1994 16:00:00 GMT', 'Cache-Control': 'no-cache="set-cookie, set-cookie2"', 'X-OneAgent-JS-Injection': 'true', 'X-ruxit-JS-Agent': 'true', 'Server-Timing': 'dtSInfo;desc="0", dtRpid;desc="-521266895"', 'Keep-Alive': 'timeout=10, max=99', 'Connection': 'Keep-Alive', 'Transfer-Encoding': 'chunked', 'Content-Type': 'text/html;charset=ISO-8859-1', 'Content-Language': 'en-US'}
Error 401: ACCESS-DENIED

Take a look into response history:

for resp in r1.history:
    print(resp.url)
    print(resp.text)
    print('Status Code:', resp.status_code)
    print(resp.headers)
    print('\n')

Output:

http:////url?ref=B72048061
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>302 Found</title>

Found

The document has moved here.

<address>IBM_HTTP_Server at xxx-pdm-services.eu.xxx.corp Port 1080</address>

Status Code: 302
{'Date': 'Mon, 19 Dec 2022 12:25:06 GMT', 'Cache-Control': 'no-store', 'Location': 'https://winssor12-vip.xxx.corp:443/siteminderagent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-9xex6NsJ4%2b587a54UsP5CW4QMeT35xwiKJoZua8FNdPb8Uvg%2bW%2fjUV2leieKYjCz&TARGET=-SM-HTTP%3a%2f%2fxxx--pdm--services%2eeu%2exxx%2ecorp%3a1080%2faps--web%2fP%2fview%2fO_IP%3fref%3dV92B72048061', 'Server-Timing': 'dtSInfo;desc="0", dtRpid;desc="-139048060"', 'Set-Cookie': 'dtCookie=v_4_srv_9_sn_9A3A0571C2E35B5E0D7C5AB97C0604EB_perc_100000_ol_0_mul_1_app-3Afb71c72ef431f887_1; Path=/; Domain=.xxx.corp', 'Content-Length': '570', 'Keep-Alive': 'timeout=10, max=100', 'Connection': 'Keep-Alive', 'Content-Type': 'text/html; charset=iso-8859-1'}

https://winssor12-vip.xxx.corp:443/siteminderagent/ntlm/creds.ntc?CHALLENGE=&SMAGENTNAME=-SM-9xex6NsJ4%2b587a54UsP5CW4QMeT35xwiKJoZua8FNdPb8Uvg%2bW%2fjUV2leieKYjCz&TARGET=-SM-HTTP%3a%2f%2fxxx--pdm--services.eu.xxx.corp%3a1080%2faps--web%2fP%2fview%2fO_IP%3fref%3dB72048061

Status Code: 302
{'Via': 'proxy A', 'Date': 'Mon, 19 Dec 2022 12:25:06 GMT', 'Server': 'Microsoft-IIS/10.0', 'Location': 'HTTP://xxx-pdm-services.eu.xxx.corp:1080/aps-web/P/view/O_IP?ref=B72048061', 'Connection': 'Keep-Alive', 'set-cookie': 'SMCHALLENGE=NTC_CHALLENGE_DONE; path=/; domain=xxx.corp, SMSESSION=H5Ya4mHFxMf5o5wXubpUuiKrZM09+RY8Na0i+Q2kxE1aor1MQhybJlg4WgFLB5Iw8lRNFhr1qvPUElsa4g+M0obXRSvP6jt0XwQPQOHc6pnmhXYyDB6L2lAIrgccnPvZsFxYF6Cig+coLbE0DIDeWFuDXD47LXBRzTqY1KRwCOkX+oSuC0AdvhGoeIOljgthwm8KLvHEzVq9fvUSfJAPeRPOyoRRtt0JA6Vg4BgCvsiNT1KHV1/9UNugmWp668juLilZHM6ZJZZt5i//5zFMTlgxSH91z7PkQUzKBwHrxZ0BPXIC4dlVsirfaMgRcZ33T5Cj5jLuDWk628Ce3ps6JbxCopaxKiD5xQFxLGbkK0juKvqBPAlJqLG8Rvv3vEGuujPt0G8mGmysGjHBjIYup7xFzCfD4mDkB2haZAOJrIhEJ7NBERoeemak2XmeUfeM8WxdXlAAgZmcxhH5+04RovujA7Qwwv4LW22jO3nPVqBQi81sN+5faW/ZPgCXXZ4Pzd7icTri6yJYVT5SBcaMhXbxkfNwNSk7YgFrU+5BDj7rDJNjVCiGAiapEQjU+3GxrRc9Ql7Rf6+gKWEEcNrWKS68O70+0uZftnldkA8a5MmJuTQ0SyApSWMPIvICQvKzBRrhBPE5R1LWxZRZIQ3ysDhG92fg3s8Arau5dFwuFYFMvQXAAYgjSNZ4c114yfWOjcV2edtDRYH9SekqpX6QCxX0UBex0LeKjbrSmNiY2IPdmBOoxHHRA9KreHgebugh4wEX9Xrp+oUm9MjxhQee+/lqiAqcuh81crWYttu3LkaXkj0BUoRmm6rqhm3GuaSwQSAN35LpcStN/+IgEEYFsIswd1OiWNY6IfARN5nLpqQgupMhVa3G/kZpadSfDmt0/u+G07M1EjjpaJB2eoDCHeDBFVZAJhgNxtzj2Na6T0SE5JYmCSp1XdZj0oeOC33eDX1M9q9xDYOCHLhmcCcFP7KE5mi0Q3KZ7N//ws95uPTdgPwMdxxKVykNebdbEPQjMltN09Uj80ws5N4FRu/9Cyq+4L+jS0gEaZz0OIR4l0v4nhqWqtoq3s1pkTlGU8z52uJE1IKH7pO5gG5iz9+/HYpA1JIdQH/HuL2Nu6SOh14FTdrATU5Id9Ip9Wvyi62G/FgLXHh/BYHC9yxrZYQX0M3NYQSjCuDRtbhGLPKkmYvMSDl8ZGmjlLapRdaQn66J6ILPmLKnifoydT8FJizsAzVtdGhNo5yszH5iCK6Y0976oVWqYfIadT+I6RdBC+/iVVzxHYZEMxsDOLBKAKPLDR5tyK2hilM4; path=/; domain=airbus.corp', 'X-Powered-By': 'ASP.NET', 'Cache-Control': 'no-store', 'Content-Length': '0', 'Persistent-Auth': 'false'}

So as can be seen in history, NTLM authentication was completed and is redirected back to required url1. However due to some issues, which I am not able to figure out, access is denied with error code 401 as can be seen above. Another thing which I noticed is that SMchallenge in response header set cookie is 'YES' and there exists SMONDENIEDREDIR. When I checked the form in browser network for succeful login, SMchallenge in set cookies remain 'No' and there exists nothing like SMONDENIEDREDIR. I am now wondering whether NTLM authentication was successful or not and how to solve this issue!


问:
date() and now() functions no longer working in query criteria
I have looked into the references and do not see any libraries with "MISSING" at the end (see image below).

I unchecked and checked the references above that are in use, and that didn't change anything. I then tried to compile the database, and that didn't resolve the issue. I also tried creating a new database and importing all tables, queries, etc. but ran into an error that states "one or more of the newly created objects contain a data type that isn't compatible with earlier versions of access." Is it possible that this is due to updating to datetime2 from datetime? I believe I accepted that change when creating date fields in the Microsoft SQL server management studio.

update: now it appears any criteria associated with using dates is not working. I can't even run a query with the following criteria on a date field:

```<code>Between [start_date] And [end_date]
</code>```

Body:
I have looked into the references and do not see any libraries with "MISSING" at the end (see image below).

I unchecked and checked the references above that are in use, and that didn't change anything. I then tried to compile the database, and that didn't resolve the issue. I also tried creating a new database and importing all tables, queries, etc. but ran into an error that states "one or more of the newly created objects contain a data type that isn't compatible with earlier versions of access." Is it possible that this is due to updating to datetime2 from datetime? I believe I accepted that change when creating date fields in the Microsoft SQL server management studio.

update: now it appears any criteria associated with using dates is not working. I can't even run a query with the following criteria on a date field:

Between [start_date] And [end_date]


问:
show legend on PieChart
im trying to display my data on Piechart on my Kotlin app using EazeGraph library
EazeGraph

i want when i click on slice ( or display it automatically ) it display to me the data of this slice in a legend or text

kotlin code

```<code> pieChart.addPieSlice(
                        PieModel(
                            "All Members",
                            stats.countAllmembers!!.toFloat(),
                            Color.parseColor("#EF5350"),
                        ),

                    )
                    pieChart.isEnabled = true

                    pieChart.startAnimation()
</code>```

Title: show legend on PieChart

Body:
im trying to display my data on Piechart on my Kotlin app using EazeGraph library
EazeGraph

i want when i click on slice ( or display it automatically ) it display to me the data of this slice in a legend or text

kotlin code

 pieChart.addPieSlice(
                        PieModel(
                            "All Members",
                            stats.countAllmembers!!.toFloat(),
                            Color.parseColor("#EF5350"),
                        ),

                    )
                    pieChart.isEnabled = true

                    pieChart.startAnimation()


问:
Can amplify import cognito user pool from a different account?
I have many Amplify applications belonging to different AWS accounts, and I want to maintain a single Cognito user pool in a different account. Is there a way that these Amplify applications can import the Cognito user pool of a different AWS account?


问:
Differing behavior in VSCode with Maven on PC and Mac
We're using Maven in VSCode to develop with JavaFX. Maven works fine with VSCode on PCs but we can't use the "Play" button or "Run Without Debugging" on Macs.

java 19.0.1
javafx 19
maven 3.8.6
VSCode 1.74.1

On a PC, we get this:

```<code>& 'C:\Program Files\Java\jdk-19\bin\java.exe' '@C:\Users\username\AppData\Local\Temp\cp_et8lcjrjl0fge41txqyx61dgy.argfile' '-m' 'activities/activities.HelloFX'
-XX:+ShowCodeDetailsInExceptionMessages -cp "C:\\Users\\username\\SoftDevII\\2225.124.MavenStarter\\target\\classes;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19-win.jar" -XX:+ShowCodeDetailsInExceptionMessages -cp "C:\\Users\\username\\SoftDevII\\2225.124.MavenStarter\\target\\classes;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19-win.jar"
</code>```

And on Macs we get this, a very different invocation:

```<code>[Running] cd "/124-2225/2225.124.MavenStarter/src/main/java/activities/" && javac HelloFX.java && java HelloFX

HelloFX.java:3: error: package javafx.application does not exist
import javafx.application.Application; HelloFX.java:4: error: package javafx.stage does not exist
import javafx.stage.Stage;
                   ^
HelloFX.java:6: error: cannot find symbol
public class HelloFX extends Application {
                             ^
  symbol: class Application
HelloFX.java:9: error: cannot find symbol
    public void start(Stage primaryStage) throws Exception {
                      ^
  symbol:   class Stage
  location: class HelloFX
HelloFX.java:8: error: method does not override or implement a method from a supertype
    @Override
    ^
HelloFX.java:17: error: cannot find symbol
        launch(args);
        ^
  symbol:   method launch(String[])
  location: class HelloFX
</code>```

However, we can run it from the command line if we include what we already have set in VSCode's settings.json, "java.debug.settings.vmArgs":

```<code>java --module-path /Java/javafx-sdk-19/lib --add-modules javafx.controls,javafx.fxml,javafx.media activities/HelloFX.java
</code>```

In addition, we can successfully execute the single file from Maven's javafx plugin, but we will have multiple application classes so that's not a good solution. It seems like a VSCode issue, but we have no idea where or why Macs and PCs are so different.

Body:
We're using Maven in VSCode to develop with JavaFX. Maven works fine with VSCode on PCs but we can't use the "Play" button or "Run Without Debugging" on Macs.

java 19.0.1
javafx 19
maven 3.8.6
VSCode 1.74.1

On a PC, we get this:

& 'C:\Program Files\Java\jdk-19\bin\java.exe' '@C:\Users\username\AppData\Local\Temp\cp_et8lcjrjl0fge41txqyx61dgy.argfile' '-m' 'activities/activities.HelloFX'
-XX:+ShowCodeDetailsInExceptionMessages -cp "C:\\Users\\username\\SoftDevII\\2225.124.MavenStarter\\target\\classes;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19-win.jar" -XX:+ShowCodeDetailsInExceptionMessages -cp "C:\\Users\\username\\SoftDevII\\2225.124.MavenStarter\\target\\classes;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-controls\\19\\javafx-controls-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-graphics\\19\\javafx-graphics-19-win.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19.jar;C:\\Users\\username\\.m2\\repository\\org\\openjfx\\javafx-base\\19\\javafx-base-19-win.jar"

And on Macs we get this, a very different invocation:

[Running] cd "/124-2225/2225.124.MavenStarter/src/main/java/activities/" && javac HelloFX.java && java HelloFX

HelloFX.java:3: error: package javafx.application does not exist
import javafx.application.Application; HelloFX.java:4: error: package javafx.stage does not exist
import javafx.stage.Stage;
                   ^
HelloFX.java:6: error: cannot find symbol
public class HelloFX extends Application {
                             ^
  symbol: class Application
HelloFX.java:9: error: cannot find symbol
    public void start(Stage primaryStage) throws Exception {
                      ^
  symbol:   class Stage
  location: class HelloFX
HelloFX.java:8: error: method does not override or implement a method from a supertype
    @Override
    ^
HelloFX.java:17: error: cannot find symbol
        launch(args);
        ^
  symbol:   method launch(String[])
  location: class HelloFX

However, we can run it from the command line if we include what we already have set in VSCode's settings.json, "java.debug.settings.vmArgs":

java --module-path /Java/javafx-sdk-19/lib --add-modules javafx.controls,javafx.fxml,javafx.media activities/HelloFX.java

In addition, we can successfully execute the single file from Maven's javafx plugin, but we will have multiple application classes so that's not a good solution. It seems like a VSCode issue, but we have no idea where or why Macs and PCs are so different.


问:
Linux Bash Loop with if else
Like in the Title I tried to write a bash loop with if and else settings but while the if part works for now but the else part does not do anything it should

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

 x=30
 echo "Input No."
 read y
 z=29-y

 if [ $y > 29 ]
 then
 while (( $x <= $y ))
 do
 echo "TEST-No.$x" >> /home/TEST/test
 x=$(($x+1))
 done
 else
 while (($z>0))
 do
 sed -i '$d' /home/TEST/test
 z=$(($z-1))
 done
 fi

cat /home/TEST/test
</code>```

if y>29 then it should write the line TEST-No.$x into the file test till x<y

```<code>root@TEST:/home/TEST# ./loop
Input No.
30
TEST-No.1
TEST-No.2
TEST-No.3
TEST-No.4
...
TEST-No.29
TEST-No.30
</code>```

if y<=29 then if should delete the last line of the file till z = 0

```<code>root@TEST:/home/TEST# ./loop
Input No.
10
TEST-No.1
TEST-No.2
TEST-No.3
TEST-No.4
...
TEST-No.29
</code>```

Title: Linux Bash Loop with if else

Body:
Like in the Title I tried to write a bash loop with if and else settings but while the if part works for now but the else part does not do anything it should

 #!/bin/bash

 x=30
 echo "Input No."
 read y
 z=29-y

 if [ $y > 29 ]
 then
 while (( $x <= $y ))
 do
 echo "TEST-No.$x" >> /home/TEST/test
 x=$(($x+1))
 done
 else
 while (($z>0))
 do
 sed -i '$d' /home/TEST/test
 z=$(($z-1))
 done
 fi

cat /home/TEST/test

if y>29 then it should write the line TEST-No.$x into the file test till x<y

root@TEST:/home/TEST# ./loop
Input No.
30
TEST-No.1
TEST-No.2
TEST-No.3
TEST-No.4
...
TEST-No.29
TEST-No.30

if y<=29 then if should delete the last line of the file till z = 0

root@TEST:/home/TEST# ./loop
Input No.
10
TEST-No.1
TEST-No.2
TEST-No.3
TEST-No.4
...
TEST-No.29


问:
How do I query the code of a Stored Procedure in SQL
I'm a college intern and have been asked to figure out how to query the code for a stored procedure in SQL. I only know a limited amount of SQL and have had trouble finding resources about this online. Does anyone know how you would write a query to do this?

I've looked at other Stack Overflow threads about this but all of them seem to be for legacy stuff or have mixed results


问:
C program using shared memory and signals to calculate length of line ends with 'User defined signal 1' or just termination instead of answer
I had to develop a set of producer-consumer programs implementing the following interprocess communication scheme using the semaphore mechanism and shared memory in C:
Process 1 reads data from the standard input stream or file and passes it to process 2.
Process 2 retrieves the data sent by process 1, calculates the number of characters in each line and passes the determined number to process 3.
Process 3 takes the data produced by process 2 and puts it into the standard output stream. Each received data unit should be output on a separate line.

I created this code:

```<code>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <signal.h>

#define SHM_SIZE 1024
#define SEM_KEY 12345

int shm_id;
int sem_id;
char *shm_ptr;

// Handle the SIGUSR1 signal for process 1
void proces1_handler(int signo)
{
    if (signo == SIGUSR1)
    {
        // Send a signal to process 2 to read the communication link
        kill(getppid(), SIGUSR2);
    }
    else if (signo == SIGUSR2)
    {
        // Sending a signal to process 2 about reading the communication link
        kill(getppid(), SIGUSR1);
    }
    else if (signo == SIGINT)
    {
        // Sending a signal to process 2 about the completion of work
        kill(getppid(), SIGINT);
    }
}

// SIGUSR1 signal handling for process 2
void proces2_handler(int signo)
{
    if (signo == SIGUSR1)
    {
        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR1);
    }
    else if (signo == SIGUSR2)
    {
        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR2);
    }
    else if (signo == SIGINT)
    {
        // Sending a signal to process 3 about the completion of work
        kill(getppid(), SIGINT);
    }
}

// SIGUSR1 signal handling for process 3
void proces3_handler(int signo)
{
    if (signo == SIGUSR1)
    {
        // Awaiting semaphore access
        semop(sem_id, &(struct sembuf){ 0, -1, 0 }, 1);
    }
    else if (signo == SIGINT)
    {
        // Semaphore release
        semop(sem_id, &(struct sembuf){ 0, 1, 0 }, 1);

        // Semaphore removal
        semctl(sem_id, 0, IPC_RMID);

        // Detach shared memory from the process
        shmdt(shm_ptr);

        // Removal of shared memory
        shmctl(shm_id, IPC_RMID, NULL);

        // Ending the process 3
        exit(0);
    }
}

void proces1(int pipe_fd[2])
{
    FILE *fp;
    char buffer[SHM_SIZE];
    int n;

    // Open a file or input stream
    fp = fopen("dane.txt", "r");
    if (fp == NULL)
        fp = stdin;

    // Data reading loop
    while (fgets(buffer, SHM_SIZE, fp) != NULL)
    {
        // Transferring data to the process 2
        strcpy(shm_ptr, buffer);

        // Sending a signal to the process 2
        kill(getppid(), SIGUSR1);

        // Waiting for the process to read data 2
        pause();

        // Sending a signal to process 2 about reading the communication link
        kill(getppid(), SIGUSR2);
    }

    // Sending a signal to process 2 that there is no more data
    kill(getppid(), SIGINT);

    // Closing a file or input stream
    if (fp != stdin)
        fclose(fp);
}

void proces2(int pipe_fd[2])
{
    char buffer[SHM_SIZE];
    int n;

    // Loop receiving data from process 1
    while (1)
    {
        // Waiting for signal from process 1
        pause();

        // Reading data from shared memory
        strcpy(buffer, shm_ptr);

        // Calculation of the number of characters
        n = strlen(buffer);

        // Saving the number of characters to the communication link
        write(pipe_fd[1], &n, sizeof(int));

        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR1);

        // Waiting for the parent process to read the communication link
        pause();

        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR2);

        // Waiting for the process to read the communication link 3
        semop(sem_id, &(struct sembuf){ 0, -1, 0 }, 1);

        // Sending a signal to process 3 about the need to read the communication link
        kill(getppid(), SIGUSR1);
    }
}

void proces3(int pipe_fd[2])
{
    int n;

    // Loop receiving data from the process 2
    while (1)
    {
        // Waiting for signal from process 2
        pause();

        // Reading the number of characters from the communication link
        read(pipe_fd[0], &n, sizeof(int));

        // Output the number of characters to the standard output
        printf("%d\n", n);

        // Semaphore release
        semop(sem_id, &(struct sembuf){ 0, 1, 0 }, 1);
    }
}

int main(int argc, char *argv[])
{
    pid_t pid;
    int pipe_fd[2];
    union sigval value;

    // Create shared memory
    shm_id = shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0666);
    if (shm_id < 0)
    {
        perror("shmget error");
        exit(1);
    }

    // Connecting shared memory to the process
    shm_ptr = shmat(shm_id, NULL, 0);
    if (shm_ptr == (void *)-1)
    {
        perror("shmat error");
        exit(1);
    }

    // Creating a semaphore
    sem_id = semget(SEM_KEY, 1, IPC_CREAT | 0666);
    if (sem_id < 0)
    {
        perror("semget error");
        exit(1);
    }

    // Semaphore initialization
    if (semctl(sem_id, 0, SETVAL, 1) < 0)
    {
        perror("semctl error");
        exit(1);
    }

    // Creating a communication link
    if (pipe(pipe_fd) < 0)
    {
        perror("pipe error");
        exit(1);
    }

    // Signal handling setting
    signal(SIGUSR1, proces1_handler);
    signal(SIGUSR2, proces1_handler);
    signal(SIGINT, proces1_handler);

    // Creating a process 2
    pid = fork();
    if (pid == 0)
    {
        // Ustawienie obsługi sygnałów
        signal(SIGUSR1, proces2_handler);
        signal(SIGUSR2, proces2_handler);

        // Process function call 2
        proces2(pipe_fd);
        exit(0);
    }

    // Process creation 3
    pid = fork();
    if (pid == 0)
    {
        // Signal handling setting
        signal(SIGUSR1, proces3_handler);

        // Process function call 3
        proces3(pipe_fd);
        exit(0);
    }

    // Calling a process function 1
    proces1(pipe_fd);

    // Waiting for processes 2 and 3 to complete
    wait(NULL);
    wait(NULL);

    // Detach shared memory from the process
    shmdt(shm_ptr);

    // Removal of shared memory
    shmctl(shm_id, IPC_RMID, NULL);

    // Termination of the parent process
    exit(0);
}

</code>```

But instead of printing the answer it ends with 'User defined signal 1' or just termination. Could someone help with this one?

I tried adding if statements for checking values returned by functions like kill, semop etc but this didnt help.

Body:
I had to develop a set of producer-consumer programs implementing the following interprocess communication scheme using the semaphore mechanism and shared memory in C:
Process 1 reads data from the standard input stream or file and passes it to process 2.
Process 2 retrieves the data sent by process 1, calculates the number of characters in each line and passes the determined number to process 3.
Process 3 takes the data produced by process 2 and puts it into the standard output stream. Each received data unit should be output on a separate line.

I created this code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <signal.h>

#define SHM_SIZE 1024
#define SEM_KEY 12345

int shm_id;
int sem_id;
char *shm_ptr;

// Handle the SIGUSR1 signal for process 1
void proces1_handler(int signo)
{
    if (signo == SIGUSR1)
    {
        // Send a signal to process 2 to read the communication link
        kill(getppid(), SIGUSR2);
    }
    else if (signo == SIGUSR2)
    {
        // Sending a signal to process 2 about reading the communication link
        kill(getppid(), SIGUSR1);
    }
    else if (signo == SIGINT)
    {
        // Sending a signal to process 2 about the completion of work
        kill(getppid(), SIGINT);
    }
}

// SIGUSR1 signal handling for process 2
void proces2_handler(int signo)
{
    if (signo == SIGUSR1)
    {
        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR1);
    }
    else if (signo == SIGUSR2)
    {
        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR2);
    }
    else if (signo == SIGINT)
    {
        // Sending a signal to process 3 about the completion of work
        kill(getppid(), SIGINT);
    }
}

// SIGUSR1 signal handling for process 3
void proces3_handler(int signo)
{
    if (signo == SIGUSR1)
    {
        // Awaiting semaphore access
        semop(sem_id, &(struct sembuf){ 0, -1, 0 }, 1);
    }
    else if (signo == SIGINT)
    {
        // Semaphore release
        semop(sem_id, &(struct sembuf){ 0, 1, 0 }, 1);

        // Semaphore removal
        semctl(sem_id, 0, IPC_RMID);

        // Detach shared memory from the process
        shmdt(shm_ptr);

        // Removal of shared memory
        shmctl(shm_id, IPC_RMID, NULL);

        // Ending the process 3
        exit(0);
    }
}

void proces1(int pipe_fd[2])
{
    FILE *fp;
    char buffer[SHM_SIZE];
    int n;

    // Open a file or input stream
    fp = fopen("dane.txt", "r");
    if (fp == NULL)
        fp = stdin;

    // Data reading loop
    while (fgets(buffer, SHM_SIZE, fp) != NULL)
    {
        // Transferring data to the process 2
        strcpy(shm_ptr, buffer);

        // Sending a signal to the process 2
        kill(getppid(), SIGUSR1);

        // Waiting for the process to read data 2
        pause();

        // Sending a signal to process 2 about reading the communication link
        kill(getppid(), SIGUSR2);
    }

    // Sending a signal to process 2 that there is no more data
    kill(getppid(), SIGINT);

    // Closing a file or input stream
    if (fp != stdin)
        fclose(fp);
}

void proces2(int pipe_fd[2])
{
    char buffer[SHM_SIZE];
    int n;

    // Loop receiving data from process 1
    while (1)
    {
        // Waiting for signal from process 1
        pause();

        // Reading data from shared memory
        strcpy(buffer, shm_ptr);

        // Calculation of the number of characters
        n = strlen(buffer);

        // Saving the number of characters to the communication link
        write(pipe_fd[1], &n, sizeof(int));

        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR1);

        // Waiting for the parent process to read the communication link
        pause();

        // Sending a signal to the parent process about reading the communication link
        kill(getppid(), SIGUSR2);

        // Waiting for the process to read the communication link 3
        semop(sem_id, &(struct sembuf){ 0, -1, 0 }, 1);

        // Sending a signal to process 3 about the need to read the communication link
        kill(getppid(), SIGUSR1);
    }
}

void proces3(int pipe_fd[2])
{
    int n;

    // Loop receiving data from the process 2
    while (1)
    {
        // Waiting for signal from process 2
        pause();

        // Reading the number of characters from the communication link
        read(pipe_fd[0], &n, sizeof(int));

        // Output the number of characters to the standard output
        printf("%d\n", n);

        // Semaphore release
        semop(sem_id, &(struct sembuf){ 0, 1, 0 }, 1);
    }
}

int main(int argc, char *argv[])
{
    pid_t pid;
    int pipe_fd[2];
    union sigval value;

    // Create shared memory
    shm_id = shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0666);
    if (shm_id < 0)
    {
        perror("shmget error");
        exit(1);
    }

    // Connecting shared memory to the process
    shm_ptr = shmat(shm_id, NULL, 0);
    if (shm_ptr == (void *)-1)
    {
        perror("shmat error");
        exit(1);
    }

    // Creating a semaphore
    sem_id = semget(SEM_KEY, 1, IPC_CREAT | 0666);
    if (sem_id < 0)
    {
        perror("semget error");
        exit(1);
    }

    // Semaphore initialization
    if (semctl(sem_id, 0, SETVAL, 1) < 0)
    {
        perror("semctl error");
        exit(1);
    }

    // Creating a communication link
    if (pipe(pipe_fd) < 0)
    {
        perror("pipe error");
        exit(1);
    }

    // Signal handling setting
    signal(SIGUSR1, proces1_handler);
    signal(SIGUSR2, proces1_handler);
    signal(SIGINT, proces1_handler);

    // Creating a process 2
    pid = fork();
    if (pid == 0)
    {
        // Ustawienie obsługi sygnałów
        signal(SIGUSR1, proces2_handler);
        signal(SIGUSR2, proces2_handler);

        // Process function call 2
        proces2(pipe_fd);
        exit(0);
    }

    // Process creation 3
    pid = fork();
    if (pid == 0)
    {
        // Signal handling setting
        signal(SIGUSR1, proces3_handler);

        // Process function call 3
        proces3(pipe_fd);
        exit(0);
    }

    // Calling a process function 1
    proces1(pipe_fd);

    // Waiting for processes 2 and 3 to complete
    wait(NULL);
    wait(NULL);

    // Detach shared memory from the process
    shmdt(shm_ptr);

    // Removal of shared memory
    shmctl(shm_id, IPC_RMID, NULL);

    // Termination of the parent process
    exit(0);
}

But instead of printing the answer it ends with 'User defined signal 1' or just termination. Could someone help with this one?

I tried adding if statements for checking values returned by functions like kill, semop etc but this didnt help.


问:
AWS ECS Tasks are killed by OOM killer without exceeding memory reserves
We have an Elixir application that is being frequently killed by Amazon ECS for being "OutOfMemoryError: Container killed due to memory usage".

We're using Fargate for our deployments, with 8GB ram containers. We have 4 instances running at a time. When the OutOfMemoryError happens, all containers are killed. We track memory usage with AWS & NewRelic, and at no time does the memory come near the max allowable limit of the container. Additionally all containers are killed at the same time. Seemingly it's killing the containers at only 60% memory usage.

What we're trying to figure out is why this is happening & what we can do to prevent these unexpected memory kill events. Even if one container was killed as it approaches 60%, we'd be in a better place than all containers being killed at the same time.

This graph shows the memory utilization (on average) of the ECS application. You can see at the peak it uses about 5GB of memory (blue line), which is well below the reserved memory (orange line). The green line shows the containers (tasks) restarting.

Here's a snippet of our Task Definition (redacted where necessary):

{
    "taskDefinitionArn": "our-task",
    "containerDefinitions": [
        {
            "name": "our-application",
            "image": "image-on-registry",
            "cpu": 0,
            "portMappings": [
                {
                    "containerPort": 8080,
                    "hostPort": 8080,
                    "protocol": "tcp"
                }
            ],
            "essential": true,
            "environment": []
        }
    ],
    "networkMode": "awsvpc",
    "status": "ACTIVE",
    "compatibilities": [
        "EC2",
        "FARGATE"
    ],
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "cpu": "4096",
    "memory": "8192"
}
```

This issue has been baffling us for awhile and causes downtime every or every other day. Thanks for your help!

Body:
We have an Elixir application that is being frequently killed by Amazon ECS for being "OutOfMemoryError: Container killed due to memory usage".

We're using Fargate for our deployments, with 8GB ram containers. We have 4 instances running at a time. When the OutOfMemoryError happens, all containers are killed. We track memory usage with AWS & NewRelic, and at no time does the memory come near the max allowable limit of the container. Additionally all containers are killed at the same time. Seemingly it's killing the containers at only 60% memory usage.

What we're trying to figure out is why this is happening & what we can do to prevent these unexpected memory kill events. Even if one container was killed as it approaches 60%, we'd be in a better place than all containers being killed at the same time.

This graph shows the memory utilization (on average) of the ECS application. You can see at the peak it uses about 5GB of memory (blue line), which is well below the reserved memory (orange line). The green line shows the containers (tasks) restarting.

Here's a snippet of our Task Definition (redacted where necessary):

{
    "taskDefinitionArn": "our-task",
    "containerDefinitions": [
        {
            "name": "our-application",
            "image": "image-on-registry",
            "cpu": 0,
            "portMappings": [
                {
                    "containerPort": 8080,
                    "hostPort": 8080,
                    "protocol": "tcp"
                }
            ],
            "essential": true,
            "environment": []
        }
    ],
    "networkMode": "awsvpc",
    "status": "ACTIVE",
    "compatibilities": [
        "EC2",
        "FARGATE"
    ],
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "cpu": "4096",
    "memory": "8192"
}

This issue has been baffling us for awhile and causes downtime every or every other day. Thanks for your help!


问:
How to pass custom datatype while calling MPI_Bcast?
I am using 'custom' precision defined as integer, parameter :: dp = selected_real_kind(15,307). Then Real(dp) is used to declare the buffer.

Using call MPI_Bcast(buffername,int count,dp,0,MPI_COMM_WORLD,ierr) gives me error Invalid datatype for dp.

Is there a way to pass this custom-defined datatype?


问:
Validate dynamically created child components and pass the validation to parent component
I want to achieve 2 tasks through validation in Quasar.
Firstly, I have a parent component that contains a few child components. The user is allowed to create another set of child components under the same parent components to add more data. If a user creates a new set of child components, I now have 2 different items array.

I want to achieve the following:

Validate each item according to a certain rule

Send the validation results to the parent component so that it displays a 'check icon' if all the child components are filled correctly or a 'negative icon' if any of them are invalid.

I am able to validate each item of the child component individually but I am not able to collect the validations and pass the status to the parent component.


问:
Aligning email body to match Pandas alignment
Been trying to get the email body to look like the Pandas output in the console but failed at every attempt so far. This is my latest attempt. Any help is appreciated.

Console Output:

Email Body Output:

My Code:

```<code>path = 'C:/Users/user/Desktop/PYTHON'
all_files = glob.glob(os.path.join(path,'data_*.csv'))

df_merged = pd.concat(map(pd.read_csv,all_files),ignore_index=True)
df_merged.to_csv('merged.csv',index=False,encoding='utf-8-sig')
email_body = df_merged.style.set_properties(**{'text-align': 'right'})

email_body = pd.read_csv('merged.csv')
print(email_body)
</code>```

Body:
Been trying to get the email body to look like the Pandas output in the console but failed at every attempt so far. This is my latest attempt. Any help is appreciated.

Console Output:

Email Body Output:

My Code:

path = 'C:/Users/user/Desktop/PYTHON'
all_files = glob.glob(os.path.join(path,'data_*.csv'))

df_merged = pd.concat(map(pd.read_csv,all_files),ignore_index=True)
df_merged.to_csv('merged.csv',index=False,encoding='utf-8-sig')
email_body = df_merged.style.set_properties(**{'text-align': 'right'})

email_body = pd.read_csv('merged.csv')
print(email_body)


Title: How to get Ability parameters Raschmodel in R (as done in Stata)

Body:
I am running a Rasch Model (1PL) in R and trying to replicate some Stata results and I am trying to get the person ability parameters from the output.

In R this code looks like this:

library("eRm")
haven::write_dta(raschdat1, "raschdat1.dta")
res <- RM(raschdat1)
summary(res)

Results of RM estimation:

Call:  RM(X = raschdat1)

Conditional log-likelihood: -1434.482
Number of iterations: 28
Number of parameters: 29

Item Easiness Parameters (beta) with 0.95 CI:
         Estimate Std. Error lower CI upper CI
beta I1     1.565      0.249    1.077    2.053
beta I2     0.051      0.216   -0.373    0.475
beta I3     0.782      0.222    0.347    1.217
beta I4    -0.650      0.228   -1.096   -0.204
beta I5    -1.301      0.254   -1.799   -0.802
beta I6     0.099      0.216   -0.324    0.523
beta I7     0.682      0.220    0.250    1.113
beta I8     0.732      0.221    0.299    1.165
beta I9     0.534      0.218    0.106    0.961
beta I10   -1.108      0.245   -1.587   -0.628
beta I11   -0.650      0.228   -1.096   -0.204
beta I12    0.388      0.217   -0.037    0.813
beta I13   -1.511      0.267   -2.034   -0.988
beta I14   -2.116      0.316   -2.735   -1.497
beta I15    0.340      0.216   -0.085    0.764
beta I16   -0.597      0.226   -1.041   -0.154
beta I17    0.340      0.216   -0.085    0.764
beta I18   -0.094      0.217   -0.520    0.332
beta I19   -0.759      0.231   -1.211   -0.306
beta I20    0.682      0.220    0.250    1.113
beta I21    0.937      0.226    0.495    1.379
beta I22    0.989      0.227    0.544    1.434
beta I23    0.682      0.220    0.250    1.113
beta I24    0.003      0.217   -0.422    0.427
beta I25   -0.814      0.233   -1.271   -0.358
beta I26    1.207      0.234    0.749    1.665
beta I27   -0.094      0.217   -0.520    0.332
beta I28   -0.290      0.220   -0.721    0.140
beta I29   -0.759      0.231   -1.211   -0.306
beta I30    0.732      0.221    0.299    1.165

In Stata I run this command

use "C:\xx\xxx\raschdat1.dta" , clear
gen case_id=_n
raschtest  I1 I2 I3 I4 I5 I6 I7 I8 I9 I10 I11 I12 I13 I14 I15 I16 I17 I18 I19 I20 I21 I22 I23 I24 I25 I26 I27 I28 I29 I30, id(case_id) meandiff

At least one group of scores concerns none individuals. Tests will be not computed.
Use the group or the autogroup options.

Estimation method: Conditional maximum likelihood (CML)
Number of items: 30
Number of groups: 31
Number of individuals: 100
Number of individuals with missing values: 0 (removed)
Number of individuals with nul or perfect score: 0
Conditional log-likelihood: -1434.4818
Log-likelihood: -1611.0531
               Difficulty
        Items  parameters  std Err.
-----------------------------------
            I1   -1.56528   0.24905
            I2   -0.05119   0.21631
            I3   -0.78219   0.22199
            I4    0.65024   0.22769
            I5    1.30062   0.25443
            I6   -0.09931   0.21614
            I7   -0.68169   0.22014
            I8   -0.73173   0.22102
            I9   -0.53365   0.21805
           I10    1.10774   0.24471
           I11    0.65024   0.22769
           I12   -0.38790   0.21672
           I13    1.51118   0.26696
           I14    2.11614   0.31587
           I15   -0.33965   0.21643
           I16    0.59712   0.22623
           I17   -0.33965   0.21643
           I18    0.09390   0.21730
           I19    0.75873   0.23100
           I20   -0.68169   0.22014
           I21   -0.93656   0.22551
           I22   -0.98918   0.22690
           I23   -0.68169   0.22014
           I24   -0.00297   0.21656
           I25    0.81423   0.23286
           I26   -1.20714   0.23376
           I27    0.09390   0.21730
           I28    0.29043   0.21975
           I29    0.75873   0.23100
           I30   -0.73173   0.22102
-----------------------------------
The mean of the difficulty parameters is fixed to 0

                                Ability                    Expected
                Group Score  parameters  std Err.    Freq.    Score
                ---------------------------------------------------
                    0     0      -4.438     1.468        0     0.48
                ---------------------------------------------------
                    1     1      -3.287     0.868        1     1.43
                ---------------------------------------------------
                    2     2      -2.722     0.689        1     2.39
                ---------------------------------------------------
                    3     3      -2.330     0.596        1     3.35
                ---------------------------------------------------
                    4     4      -2.022     0.538        3     4.31
                ---------------------------------------------------
                    5     5      -1.764     0.499        1     5.27
                ---------------------------------------------------
                    6     6      -1.537     0.471        5     6.24
                ---------------------------------------------------
                    7     7      -1.332     0.450        5     7.21
                ---------------------------------------------------
                    8     8      -1.144     0.434        3     8.18
                ---------------------------------------------------
                    9     9      -0.967     0.421        5     9.15
                ---------------------------------------------------
                   10    10      -0.798     0.412        6     10.12
                ---------------------------------------------------
                   11    11      -0.636     0.405        4     11.10
                ---------------------------------------------------
                   12    12      -0.479     0.400        6     12.07
                ---------------------------------------------------
                   13    13      -0.325     0.396        6     13.04
                ---------------------------------------------------
                   14    14      -0.172     0.395        7     14.02
                ---------------------------------------------------
                   15    15      -0.021     0.395        6     14.99
                ---------------------------------------------------
                   16    16       0.132     0.396        5     15.97
                ---------------------------------------------------
                   17    17       0.286     0.399        8     16.95
                ---------------------------------------------------
                   18    18       0.442     0.403        3     17.92
                ---------------------------------------------------
                   19    19       0.603     0.409        2     18.89
                ---------------------------------------------------
                   20    20       0.769     0.417        5     19.87
                ---------------------------------------------------
                   21    21       0.943     0.428        6     20.84
                ---------------------------------------------------
                   22    22       1.127     0.441        4     21.82
                ---------------------------------------------------
                   23    23       1.324     0.458        1     22.79
                ---------------------------------------------------
                   24    24       1.537     0.480        1     23.76
                ---------------------------------------------------
                   25    25       1.775     0.510        1     24.74
                ---------------------------------------------------
                   26    26       2.046     0.550        4     25.71
                ---------------------------------------------------
                   27    27       2.367     0.608        0     26.67
                ---------------------------------------------------
                   28    28       2.775     0.702        0     27.63
                ---------------------------------------------------
                   29    29       3.359     0.882        0     28.59
                ---------------------------------------------------
                   30    30       4.532     1.486        0     29.53
                ---------------------------------------------------

So, I get the same Easiness/Difficulty parameter, but how can I get the Ability Parameters? so the -4.438  for Ability Parameters = 0. I tried person.parameter(res), but that does not work


问:
Terraform Vsphere Module Failing Missing VM Customization Options For Windows Operating Systems
Error: one of windows_options or windows_sysprep_text must exist in VM customization options for Windows operating systems

```<code>with module.example-server-linuxvm.vsphere_virtual_machine.vm[1],
on .terraform/modules/example-server-linuxvm/main.tf line 79, in resource "vsphere_virtual_machine" "vm":
79: resource "vsphere_virtual_machine" "vm" {
</code>```

In my main.tf, I have a code block as follows:

```<code># Deploy 2 linux VMs
module "example-server-linuxvm" {
  source    = "Terraform-VMWare-Modules/vm/vsphere"
  version = "3.5.0"
  vmtemp    = "Ubuntu 22.04 LTS"
  instances = 2
  vmname    = "example-server-linux"
  vmrp      = ""
  network = {
    "VLAN136" = ["", ""] # To use DHCP create Empty list ["",""]; You can also use a CIDR annotation;
  }
  vmgateway = "172.22.136.1"
  dc        = ""
  datastore = ""
}
</code>```

Steps tried:

Adding a "is_windows_image = false" boolean in the module

Also tried adding "is_windows_image = false" boolean in my variables.tf file, but same error.

Body:
Error: one of windows_options or windows_sysprep_text must exist in VM customization options for Windows operating systems

with module.example-server-linuxvm.vsphere_virtual_machine.vm[1],
on .terraform/modules/example-server-linuxvm/main.tf line 79, in resource "vsphere_virtual_machine" "vm":
79: resource "vsphere_virtual_machine" "vm" {

In my main.tf, I have a code block as follows:

# Deploy 2 linux VMs
module "example-server-linuxvm" {
  source    = "Terraform-VMWare-Modules/vm/vsphere"
  version = "3.5.0"
  vmtemp    = "Ubuntu 22.04 LTS"
  instances = 2
  vmname    = "example-server-linux"
  vmrp      = ""
  network = {
    "VLAN136" = ["", ""] # To use DHCP create Empty list ["",""]; You can also use a CIDR annotation;
  }
  vmgateway = "172.22.136.1"
  dc        = ""
  datastore = ""
}

Steps tried:

Adding a "is_windows_image = false" boolean in the module

Also tried adding "is_windows_image = false" boolean in my variables.tf file, but same error.