问:
keycloak cannot create user to access admin console
I am not able to create a user to access the admin console even if I have removed the values that I had previously set on the yaml file that I use to deploy the helm chart for keycloak for KEYCLOAK_USER and KEYCLOAK_PASSWORD.

I have also tried with the previous values that I had for KEYCLOAK_USER and KEYCLOAK_PASSWORD (admin/admin).

I only have the pvc and pv volumes for postgres when I list them with kubectl get pvc or kubectl get pv.

```<code>$ kubectl get pv
NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                 STORAGECLASS   REASON   AGE
postgres-pv-volume-keycloakx   5Gi        RWX            Retain           Bound    default/postgres-pv-claim-keycloakx   manual                  34h
postgres-pv-volume-old         5Gi        RWX            Retain           Bound    default/postgres-pv-claim-old         manual                  32h
</code>```
```<code>$ kubectl get pvc
NAME                          STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS   AGE
postgres-pv-claim-keycloakx   Bound    postgres-pv-volume-keycloakx   5Gi        RWX            manual         34h
postgres-pv-claim-old         Bound    postgres-pv-volume-old         5Gi        RWX            manual         32h
</code>```

This is my yaml file for the deployment of the helm chart:

values.yaml:

```<code>postgresql:
  enabled: false

extraEnv: |
  - name: DB_VENDOR
    value: postgres
  - name: DB_ADDR
    value: "192.168.49.2"
  - name: DB_PORT
    value: "31298"
  - name: DB_DATABASE
    value: keycloak
  - name: DB_USER
    value: keycloak
  - name: DB_PASSWORD
    value: keycloak
  - name: PROXY_ADDRESS_FORWARDING
    value: "true"
  - name: JDBC_PARAMS
    value: "connectTimeout=30000"
</code>```

Removing the values for KEYCLOAK_USER and KEYCLOAK_PASSWORD as I did on the yaml file, I should be able to create a user to access the admin console but that option to create the user is not appearing on the screen:

On the terminal if I also try with admin/admin I get the following error:

```<code>00:09:09,222 WARN  [org.keycloak.events] (default task-7) type=LOGIN_ERROR, realmId=master, clientId=security-admin-console, userId=dc446ce2-9456-40e6-8402-9d31f5439178, ipAddress=127.0.0.1, error=invalid_user_credentials, auth_method=openid-connect, auth_type=code, redirect_uri=http://localhost:8080/auth/admin/master/console/, code_id=5b1d57d9-c11b-423b-ba1b-a56bdbbe95b1, username=admin, authSessionParentId=5b1d57d9-c11b-423b-ba1b-a56bdbbe95b1, authSessionTabId=FVdtaK5wOZA
</code>```

I am running this pod for keycloak and another pod with postgres on minikube with wsl2.

Any help or guidance on this would be appreciated.

Body:
I am not able to create a user to access the admin console even if I have removed the values that I had previously set on the yaml file that I use to deploy the helm chart for keycloak for KEYCLOAK_USER and KEYCLOAK_PASSWORD.

I have also tried with the previous values that I had for KEYCLOAK_USER and KEYCLOAK_PASSWORD (admin/admin).

I only have the pvc and pv volumes for postgres when I list them with kubectl get pvc or kubectl get pv.

$ kubectl get pv
NAME                           CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                 STORAGECLASS   REASON   AGE
postgres-pv-volume-keycloakx   5Gi        RWX            Retain           Bound    default/postgres-pv-claim-keycloakx   manual                  34h
postgres-pv-volume-old         5Gi        RWX            Retain           Bound    default/postgres-pv-claim-old         manual                  32h

$ kubectl get pvc
NAME                          STATUS   VOLUME                         CAPACITY   ACCESS MODES   STORAGECLASS   AGE
postgres-pv-claim-keycloakx   Bound    postgres-pv-volume-keycloakx   5Gi        RWX            manual         34h
postgres-pv-claim-old         Bound    postgres-pv-volume-old         5Gi        RWX            manual         32h

This is my yaml file for the deployment of the helm chart:

values.yaml:

postgresql:
  enabled: false

extraEnv: |
  - name: DB_VENDOR
    value: postgres
  - name: DB_ADDR
    value: "192.168.49.2"
  - name: DB_PORT
    value: "31298"
  - name: DB_DATABASE
    value: keycloak
  - name: DB_USER
    value: keycloak
  - name: DB_PASSWORD
    value: keycloak
  - name: PROXY_ADDRESS_FORWARDING
    value: "true"
  - name: JDBC_PARAMS
    value: "connectTimeout=30000"

Removing the values for KEYCLOAK_USER and KEYCLOAK_PASSWORD as I did on the yaml file, I should be able to create a user to access the admin console but that option to create the user is not appearing on the screen:

On the terminal if I also try with admin/admin I get the following error:

00:09:09,222 WARN  [org.keycloak.events] (default task-7) type=LOGIN_ERROR, realmId=master, clientId=security-admin-console, userId=dc446ce2-9456-40e6-8402-9d31f5439178, ipAddress=127.0.0.1, error=invalid_user_credentials, auth_method=openid-connect, auth_type=code, redirect_uri=http://localhost:8080/auth/admin/master/console/, code_id=5b1d57d9-c11b-423b-ba1b-a56bdbbe95b1, username=admin, authSessionParentId=5b1d57d9-c11b-423b-ba1b-a56bdbbe95b1, authSessionTabId=FVdtaK5wOZA

I am running this pod for keycloak and another pod with postgres on minikube with wsl2.

Any help or guidance on this would be appreciated.


来源: stackexchange

问:
Is there a way to import a svg file directly into angular 14+ component?
I'm trying to plot a map graph with apache echarts (https://echarts.apache.org/examples/en/editor.html?c=geo-seatmap-flight) in angular component but I can't find the right way to import my .svg file located in the assets/images/light-seats.svg directory directly into the component in order to initialize the "echarts.reisterMap" function.

```<code>import { Component, OnInit } from '@angular/core';
import { EChartsOption } from 'echarts';
import * as echarts from 'echarts';

// here is the error
import * as flight from 'src/assets/images/flight-seats.svg';

@Component({
  selector: 'app-clinic-file',
  templateUrl: './clinic-file.component.html',
  styleUrls: ['./clinic-file.component.sass']
})
export class ClinicFileComponent implements OnInit {

  takenSeatNames = ['26E', '26D', '26C', '25D', '23C', '21A', '20F'];

  option: EChartsOption = {...};

  makeTakenRegions(takenSeatNames: string[]) {...};

  constructor(
  ) {
  }

  ngOnInit(): void {
    this.mapFunction();
  }

  mapFunction() {
    echarts.registerMap('flight-seats', { svg: flight });
  }
}
</code>```

my html looks like this:

```<code><mat-card>
    <mat-card-content>
        <mat-card-title>Graph</mat-card-title>
        <mat-card-subtitle>Example echarts</mat-card-subtitle>
        <div echarts [options]="option">
        </div>
        </mat-card-content>
 </mat-card>
</code>```

note: additionally i am using ngx-echarts (https://www.npmjs.com/package/ngx-echarts)

I tried to import directly the svg file using "import * as flight from 'src/assets/images/flight-seats.svg';" but the interpreter shows an error like: Cannot find module "src/assets/images/flight-seats.svg" and its corresponding type declarations.ts(2307)

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to plot a map graph with apache echarts (https://echarts.apache.org/examples/en/editor.html?c=geo-seatmap-flight) in angular component but I can't find the right way to import my .svg file located in the assets/images/light-seats.svg directory directly into the component in order to initialize the "echarts.reisterMap" function.

import { Component, OnInit } from '@angular/core';
import { EChartsOption } from 'echarts';
import * as echarts from 'echarts';

// here is the error
import * as flight from 'src/assets/images/flight-seats.svg';

@Component({
  selector: 'app-clinic-file',
  templateUrl: './clinic-file.component.html',
  styleUrls: ['./clinic-file.component.sass']
})
export class ClinicFileComponent implements OnInit {

  takenSeatNames = ['26E', '26D', '26C', '25D', '23C', '21A', '20F'];

  option: EChartsOption = {...};

  makeTakenRegions(takenSeatNames: string[]) {...};

  constructor(
  ) {
  }

  ngOnInit(): void {
    this.mapFunction();
  }

  mapFunction() {
    echarts.registerMap('flight-seats', { svg: flight });
  }
}

my html looks like this:

<mat-card>
    <mat-card-content>
        <mat-card-title>Graph</mat-card-title>
        <mat-card-subtitle>Example echarts</mat-card-subtitle>

        </mat-card-content>
 </mat-card>

note: additionally i am using ngx-echarts (https://www.npmjs.com/package/ngx-echarts)

I tried to import directly the svg file using "import * as flight from 'src/assets/images/flight-seats.svg';" but the interpreter shows an error like: Cannot find module "src/assets/images/flight-seats.svg" and its corresponding type declarations.ts(2307)


问:
Iterate over a big Pandas Dataframe
I have been trying to get the rows of a Dataframe that fullfill certain condition but it takes a really long time to complete. What I have is

```<code>latitud codigoSerial    nombre                        longitud                 variableConsulta fecha

6.379038    3   Girardota - S.O.S Aburrá Norte      -75.450913  pm25    2018-08-28
</code>```

And it goes like that but with 183981 rows and I have to get all the ones that have the word "Medellin" in nombre

What I did was to use to check which codigoSerial  were used by Medellin and put all of them on a list, then I started to iterate over the dataframe checking if its codigoSerial were on the list and if it were the row was append on a different dataframe, is there any other more efficient option?

```<code>cod = [25,44,79,80,83,84,85,86]

final2 = pd.DataFrame(columns = ["latitud", "codigoSerial", "nombre", "nombreCorto", "longitud", "variableConsulta", "fecha", "calidad", "valor"])
indices = []

for i in range(len(antioquia["codigoSerial"])):
  if antioquia["codigoSerial"].iloc[i] in cod:
    indices.append(i)

for i in indices:
  final2 = final2.append(antioquia.iloc[i])

</code>```

Title: Iterate over a big Pandas Dataframe

Body:
I have been trying to get the rows of a Dataframe that fullfill certain condition but it takes a really long time to complete. What I have is

latitud codigoSerial    nombre                        longitud                 variableConsulta fecha

6.379038    3   Girardota - S.O.S Aburrá Norte      -75.450913  pm25    2018-08-28

And it goes like that but with 183981 rows and I have to get all the ones that have the word "Medellin" in nombre

What I did was to use to check which codigoSerial  were used by Medellin and put all of them on a list, then I started to iterate over the dataframe checking if its codigoSerial were on the list and if it were the row was append on a different dataframe, is there any other more efficient option?

cod = [25,44,79,80,83,84,85,86]

final2 = pd.DataFrame(columns = ["latitud", "codigoSerial", "nombre", "nombreCorto", "longitud", "variableConsulta", "fecha", "calidad", "valor"])
indices = []

for i in range(len(antioquia["codigoSerial"])):
  if antioquia["codigoSerial"].iloc[i] in cod:
    indices.append(i)

for i in indices:
  final2 = final2.append(antioquia.iloc[i])


问:
How to mathematically describe a graph convolutional network architecture?
I have developed a GCN architecture with 3 different inputs, related to 3 different blocks of layers. After that, the outputs of those layers are concatenated. And after that, the architecture has a fully connected layer. I detail the architecture involves:

Input block (there are three of these, independent from each other): Graph convolutional layer Tanh function global_max_pool layer

Concatenation, which concatenates the results of these three input blocks

Fully connected layer

How can I provide a mathematical description of this architecture (in functional style), like the description provided on page 23 of the network represented in figur2 2.1 of this text? https://uwspace.uwaterloo.ca/bitstream/handle/10012/18264/Nguyen_Duy.pdf?sequence=3&isAllowed=y


问:
MUI Autocomplete with FreeSolo not detecting value of onInputChange
I'm using MUI's Autocomplete component with freeSolo so that the user may either select an option from the dropdown or input a value into the textfield. I am able to obtain the value of both: when the user selects and types in an arbitrary value.

However, it's only detecting the value onChange, not onInputChange. I need to distinguish between the value being selected from the options or entered as free text. I need to be able to prompt the user that they are submitting a unique option.

This is the basic MUI Autocomplete component:

```<code>export default function ControllableStates() {
  const [value, setValue] = React.useState(null);
  const [inputValue, setInputValue] = React.useState('');

  return (
    <div>
        <div>{`InputValue: '${inputValue}'`}</div>
        <div>{`Value: '${value}'`}</div>
      <br />
      <Autocomplete
        freeSolo
        value={value}
        onChange={(event, newValue) => {
          setValue(newValue);
        }}
        inputValue={inputValue}
        onInputChange={(event, newInputValue) => {
          setInputValue(newInputValue);
        }}
        id="controllable-states-demo"
        options={data.map((option) => option.name)}
        sx={{ width: 300 }}
        renderInput={(params) => <TextField {...params} label="Controllable" />}
      />
    </div>
  );
}
</code>```

Body:
I'm using MUI's Autocomplete component with freeSolo so that the user may either select an option from the dropdown or input a value into the textfield. I am able to obtain the value of both: when the user selects and types in an arbitrary value.

However, it's only detecting the value onChange, not onInputChange. I need to distinguish between the value being selected from the options or entered as free text. I need to be able to prompt the user that they are submitting a unique option.

This is the basic MUI Autocomplete component:

export default function ControllableStates() {
  const [value, setValue] = React.useState(null);
  const [inputValue, setInputValue] = React.useState('');

  return (

{`InputValue: '${inputValue}'`}

{`Value: '${value}'`}

      <Autocomplete
        freeSolo
        value={value}
        onChange={(event, newValue) => {
          setValue(newValue);
        }}
        inputValue={inputValue}
        onInputChange={(event, newInputValue) => {
          setInputValue(newInputValue);
        }}
        id="controllable-states-demo"
        options={data.map((option) => option.name)}
        sx={{ width: 300 }}
        renderInput={(params) => <TextField {...params} label="Controllable" />}
      />

  );
}


问:
How do I launch anaconda GUI inside WSL?
I'm trying to follow this guide which details how to install conda on WSL.

I have installed conda without issue but I can't launch the GUI on the last step. The guide indicated that once the conda is installed within WSL, I should be able to launch the conda GUI through MobaXterm as shown below:

The issue is that I get the following error:

(MobaXterm WSL-Ubuntu) Terminal output:

```<code>(base) me@DESKTOP:~$ anaconda-navigator
2022-12-16 01:02:41,329 - WARNING linux_scaling.get_scaling_factor_using_dbus:32
An exception occurred during fetching list of system display settings.

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

Aborted (core dumped)
(base) me@DESKTOP:~$
</code>```

I've tried reinstalling xcb but this had no effect, I've also looked online and not found anything relevant. Does anyone know how to resolve this so I can launch anaconda GUI through WSL?

Body:
I'm trying to follow this guide which details how to install conda on WSL.

I have installed conda without issue but I can't launch the GUI on the last step. The guide indicated that once the conda is installed within WSL, I should be able to launch the conda GUI through MobaXterm as shown below:

The issue is that I get the following error:

(MobaXterm WSL-Ubuntu) Terminal output:

(base) me@DESKTOP:~$ anaconda-navigator
2022-12-16 01:02:41,329 - WARNING linux_scaling.get_scaling_factor_using_dbus:32
An exception occurred during fetching list of system display settings.

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

Aborted (core dumped)
(base) me@DESKTOP:~$

I've tried reinstalling xcb but this had no effect, I've also looked online and not found anything relevant. Does anyone know how to resolve this so I can launch anaconda GUI through WSL?


问:
reporting error messages when using ajv.addKeyword
```<code>const ajv = require("ajv");
const add_formats = require("ajv-formats");
const add_errors = require("ajv-errors");

const ajv_inst = new ajv({ $data: true, allErrors: true });
add_errors(add_formats(ajv_inst));

ajv_inst.addKeyword({
  keyword: "age",
  validate: (schema, data) => schema.max_age >= data && schema.min_age <= data,
  metaSchema: {
    // schema to validate keyword value
    type: "object",
    properties: {
      min_age: { type: "integer" },
      max_age: { type: "integer" },
    },
    required: ["min_age", "max_age"],
    additionalProperties: false,
  },
});

const schema = {
  age: {
    min_age: 18,
    max_age: 100,
  },
};
const validate = ajv_inst.compile(schema);
console.log(validate(17));
console.log(ajv_inst.errors);
</code>```

output:

```<code>false
null
</code>```

So it is working properly, except that there is no error message. How do I add custom error messages for custom keywords?

Body:
const ajv = require("ajv");
const add_formats = require("ajv-formats");
const add_errors = require("ajv-errors");

const ajv_inst = new ajv({ $data: true, allErrors: true });
add_errors(add_formats(ajv_inst));

ajv_inst.addKeyword({
  keyword: "age",
  validate: (schema, data) => schema.max_age >= data && schema.min_age <= data,
  metaSchema: {
    // schema to validate keyword value
    type: "object",
    properties: {
      min_age: { type: "integer" },
      max_age: { type: "integer" },
    },
    required: ["min_age", "max_age"],
    additionalProperties: false,
  },
});

const schema = {
  age: {
    min_age: 18,
    max_age: 100,
  },
};
const validate = ajv_inst.compile(schema);
console.log(validate(17));
console.log(ajv_inst.errors);

output:

false
null

So it is working properly, except that there is no error message. How do I add custom error messages for custom keywords?


问:
Returning File Path From tk GUI
I using tkinter and tkinterdnd2 to make a drag and drop GUI (I am using the below code). How do I return the value of the path name to use later? When I try to print(get_path) it returns this <function get_path at 0x10cfa10d0> or if I set a global varible = event I get <tkinterdnd2.TkinterDnD.DnDEvent object at 0x164cef0d0>

```<code>def get_path(event):
    pathLabel.configure(text=event.data)

root = TkinterDnD.Tk()
root.geometry("350x100")
root.title("Get file path")

nameVar = StringVar()

entryWidget = Entry(root)
entryWidget.pack(side=TOP, padx=5, pady=5)

pathLabel = Label(root, text="Drag and drop file in the entry box")
pathLabel.pack(side=TOP)

entryWidget.drop_target_register(DND_ALL)
entryWidget.dnd_bind("<<Drop>>", get_path)

Button(root, text="Close", command=root.destroy).pack()
root.mainloop()
</code>```

Title: Returning File Path From tk GUI

Body:
I using tkinter and tkinterdnd2 to make a drag and drop GUI (I am using the below code). How do I return the value of the path name to use later? When I try to print(get_path) it returns this <function get_path at 0x10cfa10d0> or if I set a global varible = event I get <tkinterdnd2.TkinterDnD.DnDEvent object at 0x164cef0d0>

def get_path(event):
    pathLabel.configure(text=event.data)

root = TkinterDnD.Tk()
root.geometry("350x100")
root.title("Get file path")

nameVar = StringVar()

entryWidget = Entry(root)
entryWidget.pack(side=TOP, padx=5, pady=5)

pathLabel = Label(root, text="Drag and drop file in the entry box")
pathLabel.pack(side=TOP)

entryWidget.drop_target_register(DND_ALL)
entryWidget.dnd_bind("<<Drop>>", get_path)

Button(root, text="Close", command=root.destroy).pack()
root.mainloop()


问:
How to Import Image from MATLAB into Excel using VBA?
I want to get the ternary plot from Matlab and show the result(figure) in the Excell sheet and I need to do all the steps in VBA. Hence, I should run Matlab from Excel without the need to go to the MATLAB program. I have the code below that will open MATLAB and run the program and show the result for a second.

```<code>Option Explicit

Sub ternaryplot()

Dim MatLab As Object

Dim fileToRun As String

Dim matlabCommand As String

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Set MatLab = CreateObject("Matlab.Application")

MatLab.Execute ("Adress for MATLAB program")

Dim PathCrnt As String

PathCrnt = ActiveWorkbook.Path

fileToRun = PathCrnt & "matlab.m"

matlabCommand = "matlab -nodisplay -nosplash -nodesktop -r "" run('" & fileToRun & "');exit;"" "

Shell (matlabCommand)

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

End Sub
</code>```

But To show the plot in an Excell sheet I have used the MLGetFigure function. and in my code, I call the MyFigure subprocess. But it gives me an error and it said " Sub or function not found"

```<code>Sub MyFigure()

    MLGetFigure 0.8, 0.8

    MatlabRequest

End Sub
</code>```

Please help me to learn how I could show the result of the first part of my code ( which is a ternary plot from Matlab), into an Excel sheet.

Body:
I want to get the ternary plot from Matlab and show the result(figure) in the Excell sheet and I need to do all the steps in VBA. Hence, I should run Matlab from Excel without the need to go to the MATLAB program. I have the code below that will open MATLAB and run the program and show the result for a second.

Option Explicit

Sub ternaryplot()

Dim MatLab As Object

Dim fileToRun As String

Dim matlabCommand As String

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Set MatLab = CreateObject("Matlab.Application")

MatLab.Execute ("Adress for MATLAB program")

Dim PathCrnt As String

PathCrnt = ActiveWorkbook.Path

fileToRun = PathCrnt & "matlab.m"

matlabCommand = "matlab -nodisplay -nosplash -nodesktop -r "" run('" & fileToRun & "');exit;"" "

Shell (matlabCommand)

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

End Sub

But To show the plot in an Excell sheet I have used the MLGetFigure function. and in my code, I call the MyFigure subprocess. But it gives me an error and it said " Sub or function not found"

Sub MyFigure()

    MLGetFigure 0.8, 0.8

    MatlabRequest

End Sub

Please help me to learn how I could show the result of the first part of my code ( which is a ternary plot from Matlab), into an Excel sheet.


问:
How to display Jetpack compose bottom drawer on top of current compose?
I have login page in my application. On Login button click i want to display bottom drawer compose.  Not same from Login compose. Because my application is multi module, this drawer compose code should come from another module and it has it's own logic, seperate from login module.

I have tried, but login page disappear and bottom drawer display with different background. But i want login screen in background.


问:
Uncaught TypeError: proxy must report the same value for the non-writable, non-configurable property XXX
I wish to know why this error happens. I've tried searching for the error but only encounter Vue-related things.

I came across this issue today (and it is not the first time), when creating a new object from a Redux response (We use immerjs).

i.e

```<code>const data = {...useWidgetData()};
</code>```

The error went away when I used deepclone instead.

```<code>const data = deepclone(useWidgetData());
</code>```

This error does not happen in this line but later on in the execution, and I don't know if it's access or write operations that trigger it. It crashes the React app when a redux operation takes place.

I'm needing a concrete case where this can happen in vanilla javascript and an explanation please.

Body:
I wish to know why this error happens. I've tried searching for the error but only encounter Vue-related things.

I came across this issue today (and it is not the first time), when creating a new object from a Redux response (We use immerjs).

i.e

const data = {...useWidgetData()};

The error went away when I used deepclone instead.

const data = deepclone(useWidgetData());

This error does not happen in this line but later on in the execution, and I don't know if it's access or write operations that trigger it. It crashes the React app when a redux operation takes place.

I'm needing a concrete case where this can happen in vanilla javascript and an explanation please.


问:
How to log http 4XX errors in Netty-Http Apache camel route
I have many camel routes with netty-HTTP components, I'm getting intermittently 404 errors (as of now not sure if it's from the camel route). I want to log all request responses on this camel route. This works in a sunny day scenario, but I use an incorrect URL from the client side it doesn't log response details, in this case, HTTP 404. Can someone help with how this can be done?</p>


问:
Request and/or receive money via transferwise ~ WISE with a Balance Account Invitation Link
I am new to transferwise and want to ask if the thing i want to do is achiviable via the wise-api

The platform/business needs to automate one action among others:

Business need to ask the User to pay via Wise whenever they feel like ready.

Business give the balance account details (Wise balance account) (i think it is the borderless account, right? or is one of the overseas balance accounts [usd, eur, gbp...] )

User pay to business

Via webhook (i think so) we manage the user info and linked the stuff to the DB

Would be nice if i can use the "Request money" flow-endpoint which give you a payment-link with 14 days of exp. But i think you can't use that in the api :(

Are someone who made something like this before using wise?

I'm so new to wise and it is my first time implementing a thing like this from scratch (i'm the only backend dev haha)

I tried to folllow the docs, and i see the endpoints to do this in the Postman Collection, but i dont know if can solve the needs of the business.

If this the only way?

I cant use the "Request money" flow with the api?

Big thanks for reading!


问:
Flatten data matrix for better deep learning?
I am implementing Algorithm 1 from this paper. The core of the algorithm is a deep learning optimization procedure (the loss is not important). Each of my data points is a matrix of dimension 2 by N, with n such data points. I have two options for the architecture of the Neural Network:

Make the NN a function from R^2, i.e. 2 input neurons. When I apply it to a 2 by N matrix, I simply apply it to each individual column of the matrix. This makes sense from the physical point of view underlying the problem (each data point is a collection of N interacting particles in 2-dimensional space).

Make the NN a function from R^{2 x N}, i.e. 2 x N input neurons. When I apply it to a 2 by N matrix, I flatten the matrix, and apply the NN to the resulting vector. This makes sense from the deep learning point of view, since the data is "really" 2xN-dimensional.

I have implemented the former architecture. But is the second architecture more "correct"? Can I expect better accuracy from the second approach? Mathematically speaking it can approximate a strictly larger family of functions (functions with interdependence of columns of the 2xN input matrix).

I know that in image classification an image matrix gets flattened and fed into the NN as a vector. This suggests using the latter approach over the former. However, images lack the physical structure that my problem possesses: The columns of each 2XN matrix are positions of N physical particles in 2-dimensional space.


问:
Unable to authenticate to http API when using public url from same machine (Kestrel/.NET7)
I have a .NET7 service which is running kestrel to host an http API (REST controller). The service uses windows authentication with a local windows account. There is an SSL certificate installed and the service is running on a Windows VM in Azure.

When I access the service using a browser or httpClient from my home PC everything works great. e.g. https://blah.myservice.com:21000/api/foo - this challenges me for credentials, I put them in and it returns data and the browser is happy with the SSL cert.

When I access the service in the same way from another Azure VM on the same network it also works as expected.

The issue is that when I access the public URL from the same machine that the service is running on I get a 401 unauthorized response from the service.

If I do https://localhost:21000/api/foo then it challenges me for credentials and returns data just fine, but the browser is not happy with the SSL cert because the domain in the browser does not match. That's not a mystery, obviously. But the service does work. It also works using the local network IP address of the machine.

I don't understand why I get a 401 when using the public URL - it's hitting the right service because I can see the request come in through the log files, it just won't authenticate after challenging me.

The reason this bothers me is that I have a number of services running on a few VMs - sometimes they take data from each other which means they have to effectively connect to localhost to call the REST controllers on another service. This will fail with a 401 if I use the public URL, but will also fail if I use "localhost" because the certificate does not validate. e.g. this code fails when going from one service to another on the same host (or just running it as a console app on the same server):

```<code>var credentials = new NetworkCredential("username", "password");

var httpClientHandler = new SocketsHttpHandler { Credentials = credentials };
HttpClient httpClient = new HttpClient(httpClientHandler, true);

try
{
   string result = await httpClient.GetStringAsync("https://blah.myservice.com:21000/api/foo");
   Console.WriteLine(result);
}
catch (Exception ex)
{
   Console.WriteLine(ex.Message);
}

try
{
   string result = await httpClient.GetStringAsync("https://localhost:21000/api/foo");
   Console.WriteLine(result);
}
catch (Exception ex)
{
   Console.WriteLine(ex.Message);
}
</code>```

Both of the above requests fail - I realise I can set the RemoteCertificateValidationCallback to always return true but that's a hack and I have a valid SSL cert so it makes no sense to do that.

Is anyone able to explain why this doesn't work and how to fix it?

Body:
I have a .NET7 service which is running kestrel to host an http API (REST controller). The service uses windows authentication with a local windows account. There is an SSL certificate installed and the service is running on a Windows VM in Azure.

When I access the service using a browser or httpClient from my home PC everything works great. e.g. https://blah.myservice.com:21000/api/foo - this challenges me for credentials, I put them in and it returns data and the browser is happy with the SSL cert.

When I access the service in the same way from another Azure VM on the same network it also works as expected.

The issue is that when I access the public URL from the same machine that the service is running on I get a 401 unauthorized response from the service.

If I do https://localhost:21000/api/foo then it challenges me for credentials and returns data just fine, but the browser is not happy with the SSL cert because the domain in the browser does not match. That's not a mystery, obviously. But the service does work. It also works using the local network IP address of the machine.

I don't understand why I get a 401 when using the public URL - it's hitting the right service because I can see the request come in through the log files, it just won't authenticate after challenging me.

The reason this bothers me is that I have a number of services running on a few VMs - sometimes they take data from each other which means they have to effectively connect to localhost to call the REST controllers on another service. This will fail with a 401 if I use the public URL, but will also fail if I use "localhost" because the certificate does not validate. e.g. this code fails when going from one service to another on the same host (or just running it as a console app on the same server):

var credentials = new NetworkCredential("username", "password");

var httpClientHandler = new SocketsHttpHandler { Credentials = credentials };
HttpClient httpClient = new HttpClient(httpClientHandler, true);

try
{
   string result = await httpClient.GetStringAsync("https://blah.myservice.com:21000/api/foo");
   Console.WriteLine(result);
}
catch (Exception ex)
{
   Console.WriteLine(ex.Message);
}

try
{
   string result = await httpClient.GetStringAsync("https://localhost:21000/api/foo");
   Console.WriteLine(result);
}
catch (Exception ex)
{
   Console.WriteLine(ex.Message);
}

Both of the above requests fail - I realise I can set the RemoteCertificateValidationCallback to always return true but that's a hack and I have a valid SSL cert so it makes no sense to do that.

Is anyone able to explain why this doesn't work and how to fix it?


问:
socket.io use in web application
I was making a live chat feature for a website I am operating and read that socket.io is not suggested for mobile applications because it holds a live TCP connection that drains the battery. They suggested firechat as a solution for mobile. My site is in NextJS and I plan on porting to React Native for the Apps. Is it possible to make it so my socket.io only runs when the user has the app open in order to save battery life? If not, are there any other suggested methods that are free?</p>

Title: socket.io use in web application


问:
How to re-organize (reshaping) my dataset moving multiple columns into rows?
I want to re-organize a longitudinal dataset in R. The original dataset looks like the one below.

ID
y1_demo
y2_demo
y1_ex
y2_ex

100
A
B
A
B

200
B
A
A
C

I would like to see the output like the following.

ID
Year
demo
ex

100
Y1
A
A

100
Y2
B
B

200
Y1
B
A

200
Y2
A
C


问:
Blazor Server: Creating email attachments from files uploaded via InputFile
I am trying to send emails with attachments attached to the email. I have a InputFile with a progress bar that I am able to upload files. I have attempted to use the memory stream to make attachments to the MailMessage class. The issue is that when the email is received, I am able to see the attachments but I can't read or view the contents of the attachments.  I've posted my code below so you can replicate the issue that I am having (Make sure to install the Meziantou.Framework.ByteSize nuget package)

```<code>
@using System.Net.Mail
@using System.Globalization
@using Meziantou.Framework

<InputFile OnChange="e => LoadFiles(e)" multiple></InputFile>

@foreach (var file in uploadedFiles)
{
    <div>
        @file.FileName
        <progress value="@file.UploadedBytes" max="@file.Size"></progress>
        @file.UploadedPercentage.ToString("F1")%
        (@FormatBytes(file.UploadedBytes) / @FormatBytes(file.Size))
    </div>

}

<button type="button" @onclick="@HandleNotifSubmit" class="btn btn-primary submit">Send Email</button>

@code {

    private MemoryStream fileContents { get; set; }
    List<FileUploadProgress> uploadedFiles = new();
    MailMessage message = new MailMessage();
    StreamWriter writer { get; set; }

    private async ValueTask LoadFiles(InputFileChangeEventArgs e)
    {

        var files = e.GetMultipleFiles(maximumFileCount: 100);

        var startIndex = uploadedFiles.Count;

        // Add all files to the UI
        foreach (var file in files)
        {
            var progress = new FileUploadProgress(file.Name, file.Size);
            uploadedFiles.Add(progress);
        }

        // We don't want to refresh the UI too frequently,
        // So, we use a timer to update the UI every few hundred milliseconds
        await using var timer = new Timer(_ => InvokeAsync(() => StateHasChanged()));
        timer.Change(TimeSpan.FromMilliseconds(500), TimeSpan.FromMilliseconds(500));

        // Upload files
        byte[] buffer = System.Buffers.ArrayPool<byte>.Shared.Rent(4096);
        try
        {
            foreach (var file in files)
            {

                using var stream = file.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);
                while (await stream.ReadAsync(buffer) is int read && read > 0)
                {
                    uploadedFiles[startIndex].UploadedBytes += read;

                    var readData = buffer.AsMemory().Slice(0, read);
                }

                fileContents = new MemoryStream(buffer);
                writer = new StreamWriter(fileContents);
                fileContents.Position = 0;

                message.Attachments.Add(new Attachment(fileContents, file.Name));

                startIndex++;
            }
        }
        finally
        {
            System.Buffers.ArrayPool<byte>.Shared.Return(buffer);
            StateHasChanged();
        }
    }

    string FormatBytes(long value)
     => ByteSize.FromBytes(value).ToString("fi2", CultureInfo.CurrentCulture);

    record FileUploadProgress(string FileName, long Size)
    {
        public long UploadedBytes { get; set; }
        public double UploadedPercentage => (double)UploadedBytes / (double)Size * 100d;
    }

    private async void HandleNotifSubmit()
    {
        try
        {
            var sClient = new SmtpClient("FAKECOMPANYCLIENT");
            sClient.Port = 25;
            sClient.UseDefaultCredentials = false;

            message.Subject = "Hello World";
            message.From = new MailAddress("test@gmail.com");
            message.IsBodyHtml = true;
            message.To.Add(new MailAddress("Fake@gmail.com"));
            message.Body = "Please view attachments below.";

            sClient.Send(message);

            message.Dispose();
        }
    catch

    {
            Console.WriteLine("error");
        }
    }

}
</code>```

I have also tried to use a stream writer with no success. I have also tried various ways to do a file.CopyToAsync(memoryStreamname). I am not sure what else I am missing or doing wrong here.

Thank you in advance.

Body:
I am trying to send emails with attachments attached to the email. I have a InputFile with a progress bar that I am able to upload files. I have attempted to use the memory stream to make attachments to the MailMessage class. The issue is that when the email is received, I am able to see the attachments but I can't read or view the contents of the attachments.  I've posted my code below so you can replicate the issue that I am having (Make sure to install the Meziantou.Framework.ByteSize nuget package)

@using System.Net.Mail
@using System.Globalization
@using Meziantou.Framework

<InputFile OnChange="e => LoadFiles(e)" multiple></InputFile>

@foreach (var file in uploadedFiles)
{

        @file.FileName
        <progress value="@file.UploadedBytes" max="@file.Size"></progress>
        @file.UploadedPercentage.ToString("F1")%
        (@FormatBytes(file.UploadedBytes) / @FormatBytes(file.Size))

}

<button type="button" @onclick="@HandleNotifSubmit" class="btn btn-primary submit">Send Email</button>

@code {

    private MemoryStream fileContents { get; set; }
    List<FileUploadProgress> uploadedFiles = new();
    MailMessage message = new MailMessage();
    StreamWriter writer { get; set; }

    private async ValueTask LoadFiles(InputFileChangeEventArgs e)
    {

        var files = e.GetMultipleFiles(maximumFileCount: 100);

        var startIndex = uploadedFiles.Count;

        // Add all files to the UI
        foreach (var file in files)
        {
            var progress = new FileUploadProgress(file.Name, file.Size);
            uploadedFiles.Add(progress);
        }

        // We don't want to refresh the UI too frequently,
        // So, we use a timer to update the UI every few hundred milliseconds
        await using var timer = new Timer(_ => InvokeAsync(() => StateHasChanged()));
        timer.Change(TimeSpan.FromMilliseconds(500), TimeSpan.FromMilliseconds(500));

        // Upload files
        byte[] buffer = System.Buffers.ArrayPool<byte>.Shared.Rent(4096);
        try
        {
            foreach (var file in files)
            {

                using var stream = file.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);
                while (await stream.ReadAsync(buffer) is int read && read > 0)
                {
                    uploadedFiles[startIndex].UploadedBytes += read;

                    var readData = buffer.AsMemory().Slice(0, read);
                }

                fileContents = new MemoryStream(buffer);
                writer = new StreamWriter(fileContents);
                fileContents.Position = 0;

                message.Attachments.Add(new Attachment(fileContents, file.Name));

                startIndex++;
            }
        }
        finally
        {
            System.Buffers.ArrayPool<byte>.Shared.Return(buffer);
            StateHasChanged();
        }
    }

    string FormatBytes(long value)
     => ByteSize.FromBytes(value).ToString("fi2", CultureInfo.CurrentCulture);

    record FileUploadProgress(string FileName, long Size)
    {
        public long UploadedBytes { get; set; }
        public double UploadedPercentage => (double)UploadedBytes / (double)Size * 100d;
    }

    private async void HandleNotifSubmit()
    {
        try
        {
            var sClient = new SmtpClient("FAKECOMPANYCLIENT");
            sClient.Port = 25;
            sClient.UseDefaultCredentials = false;

            message.Subject = "Hello World";
            message.From = new MailAddress("test@gmail.com");
            message.IsBodyHtml = true;
            message.To.Add(new MailAddress("Fake@gmail.com"));
            message.Body = "Please view attachments below.";

            sClient.Send(message);

            message.Dispose();
        }
    catch

    {
            Console.WriteLine("error");
        }
    }

}

I have also tried to use a stream writer with no success. I have also tried various ways to do a file.CopyToAsync(memoryStreamname). I am not sure what else I am missing or doing wrong here.

Thank you in advance.


问:
Uncaught ReferenceError: global is not defined
I want to connect with my server using websocket but I cant deal with this error.

I have checked all the recommended solutions but none of them work. I am using Angular 15.

```<code> private serverUrl = 'http://localhost:8080/socket'
  private stompClient: any;

  constructor(private app: AppService, private http: HttpClient, private router: Router) {
    this.initializeWebSocketConnection();
  }

  initializeWebSocketConnection(){
    let ws = new SockJS(this.serverUrl);
    this.stompClient = Stomp.over(ws);
    let that = this;
    this.stompClient.connect({}, function() {
        that.stompClient.subscribe("/test", (message :any) => {
          if(message.body){
            console.log(message.body);
          }
        });
      });
  }
</code>```

Body:
I want to connect with my server using websocket but I cant deal with this error.

I have checked all the recommended solutions but none of them work. I am using Angular 15.

 private serverUrl = 'http://localhost:8080/socket'
  private stompClient: any;

  constructor(private app: AppService, private http: HttpClient, private router: Router) {
    this.initializeWebSocketConnection();
  }

  initializeWebSocketConnection(){
    let ws = new SockJS(this.serverUrl);
    this.stompClient = Stomp.over(ws);
    let that = this;
    this.stompClient.connect({}, function() {
        that.stompClient.subscribe("/test", (message :any) => {
          if(message.body){
            console.log(message.body);
          }
        });
      });
  }


问:
Telegram bot does not correctly switch between commands
I am studying aiogram and decided to make a simple bot for practice. User after math_task1 command gets the value of two numbers, the sum of which should be found, and after math_task1_1 command should find the difference and send to the bot. So: if after the first command, the button, immediately select the second, enter 2 numbers, then if you send the difference of the numbers issued counts as an error. The same happens if you restart bot with start command. If on the contrary, first math_task1_1, then math_task1, if send sum, it will be scored as an error. I.e., it is waiting for an answer to the previous command.

```<code>a = random.randrange(0, 100)
b = random.randrange(0, 100)
@dp.message_handler(commands=['math_task1'])
async def math_task1(message:types.Message):
    print(a,b,'math_task1')
    await bot.send_message(message.from_user.id,text='Начинаем')
    await message.answer(text=f'Найти сумму {a}, {b}')
    print(a, b, 'math_task1')
    c = a + b
    print(c)
    @dp.message_handler()
    async def math_task1(message: types.Message):
        global a,b
        c = a + b # 66 line
        print(c)
        if str(message.text) == str(c):
            await message.answer("Правильно")
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the sum {a}, {b}')

        else:
            await message.answer('Wrong, try again.')
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the sum {a}, {b}')

@dp.message_handler(commands=['math_task1_1'])
async def math_task(message: types.Message):

    a = random.randrange(0, 100)
    b = random.randrange(0, 100)
    print(a, b, 'math_task1_1')
    await message.answer(text=f'Найти разность {a}, {b}')
    print(a, b, 'math_task1_1')
    c = a - b
    print(c)
    @dp.message_handler()
    async def math_task1_1(message: types.Message):
        c = a - b
        print(c)
        if str(message.text) == str(c):
            await message.answer("Правильно")
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the difference {a}, {b}')

        else:
            await message.answer('Wrong, try again.')
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the difference {a}, {b}')
</code>```

I put values a,b that are outside of @dp.message_handler inside, like in the second command, then PyCharm already swore:

```<code>line 66, in math_task1
    c = a + b
        ^
NameError: name 'a' is not defined
</code>```

Body:
I am studying aiogram and decided to make a simple bot for practice. User after math_task1 command gets the value of two numbers, the sum of which should be found, and after math_task1_1 command should find the difference and send to the bot. So: if after the first command, the button, immediately select the second, enter 2 numbers, then if you send the difference of the numbers issued counts as an error. The same happens if you restart bot with start command. If on the contrary, first math_task1_1, then math_task1, if send sum, it will be scored as an error. I.e., it is waiting for an answer to the previous command.

a = random.randrange(0, 100)
b = random.randrange(0, 100)
@dp.message_handler(commands=['math_task1'])
async def math_task1(message:types.Message):
    print(a,b,'math_task1')
    await bot.send_message(message.from_user.id,text='Начинаем')
    await message.answer(text=f'Найти сумму {a}, {b}')
    print(a, b, 'math_task1')
    c = a + b
    print(c)
    @dp.message_handler()
    async def math_task1(message: types.Message):
        global a,b
        c = a + b # 66 line
        print(c)
        if str(message.text) == str(c):
            await message.answer("Правильно")
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the sum {a}, {b}')

        else:
            await message.answer('Wrong, try again.')
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the sum {a}, {b}')

@dp.message_handler(commands=['math_task1_1'])
async def math_task(message: types.Message):

    a = random.randrange(0, 100)
    b = random.randrange(0, 100)
    print(a, b, 'math_task1_1')
    await message.answer(text=f'Найти разность {a}, {b}')
    print(a, b, 'math_task1_1')
    c = a - b
    print(c)
    @dp.message_handler()
    async def math_task1_1(message: types.Message):
        c = a - b
        print(c)
        if str(message.text) == str(c):
            await message.answer("Правильно")
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the difference {a}, {b}')

        else:
            await message.answer('Wrong, try again.')
            a = random.randrange(0, 100)
            b = random.randrange(0, 100)
            await message.answer(text=f'Find the difference {a}, {b}')

I put values a,b that are outside of @dp.message_handler inside, like in the second command, then PyCharm already swore:

line 66, in math_task1
    c = a + b
        ^
NameError: name 'a' is not defined


问:
Eclipse IDE will not allow me to create a New FXML Document for JavaFX. Errors out
I am starting to learn JavaFX and SceneBuilder, and while I am installing SceneBuilder I am trying to add a new FXML document. When I right click on my project -> go to new -> other -> JavaFX folder -> New FXML document, if I click "Next" it does nothing. If I double click I get the following error:

An error has occurred. See error log for more details.
org/eclipse/jface/databinding/swt/WidgetProperties

The following is the error in the error log and the stack trace:

```<code>Message: Problems occurred when invoking code from plug-in: "org.eclipse.jface".

Stack Trace:
java.lang.NoClassDefFoundError: org/eclipse/jface/databinding/swt/WidgetProperties
    at org.eclipse.fx.ide.ui.wizards.AbstractJDTElementPage.createControl(AbstractJDTElementPage.java:109)
    at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:178)
    at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)
    at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1182)
    at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1235)
    at org.eclipse.jface.wizard.WizardDialog.lambda$3(WizardDialog.java:1223)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
    at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1223)
    at org.eclipse.ui.internal.dialogs.NewWizardSelectionPage.advanceToNextPageOrFinish(NewWizardSelectionPage.java:73)
    at org.eclipse.ui.internal.dialogs.NewWizardNewPage.lambda$0(NewWizardNewPage.java:342)
    at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:780)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
    at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:777)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1542)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1211)
    at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:272)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:329)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
    at org.eclipse.jface.window.Window.open(Window.java:799)
    at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:263)
    at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:283)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
    at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:142)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:643)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jface.databinding.swt.WidgetProperties cannot be found by org.eclipse.fx.ide.ui_3.8.0.202204150904
    ... 67 more
</code>```

I am on the newest version of Java, Exclipse, JavaFX, and SceneBuilder.

Thank you in advance for any help you can give.

Body:
I am starting to learn JavaFX and SceneBuilder, and while I am installing SceneBuilder I am trying to add a new FXML document. When I right click on my project -> go to new -> other -> JavaFX folder -> New FXML document, if I click "Next" it does nothing. If I double click I get the following error:

An error has occurred. See error log for more details.
org/eclipse/jface/databinding/swt/WidgetProperties

The following is the error in the error log and the stack trace:

Message: Problems occurred when invoking code from plug-in: "org.eclipse.jface".

Stack Trace:
java.lang.NoClassDefFoundError: org/eclipse/jface/databinding/swt/WidgetProperties
    at org.eclipse.fx.ide.ui.wizards.AbstractJDTElementPage.createControl(AbstractJDTElementPage.java:109)
    at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:178)
    at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:744)
    at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1182)
    at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1235)
    at org.eclipse.jface.wizard.WizardDialog.lambda$3(WizardDialog.java:1223)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
    at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1223)
    at org.eclipse.ui.internal.dialogs.NewWizardSelectionPage.advanceToNextPageOrFinish(NewWizardSelectionPage.java:73)
    at org.eclipse.ui.internal.dialogs.NewWizardNewPage.lambda$0(NewWizardNewPage.java:342)
    at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:780)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
    at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:777)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1542)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1211)
    at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:272)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:329)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
    at org.eclipse.jface.window.Window.open(Window.java:799)
    at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:263)
    at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:283)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
    at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:142)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:643)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jface.databinding.swt.WidgetProperties cannot be found by org.eclipse.fx.ide.ui_3.8.0.202204150904
    ... 67 more

I am on the newest version of Java, Exclipse, JavaFX, and SceneBuilder.

Thank you in advance for any help you can give.


问:
Dynamically get the database name from a Databricks DLT pipeline
How do I dynamically get the database name from a DLT pipeline?</p>


问:
tf.distribute.MultiWorkerMirroredStrategy with custom model.train_step
I am using the following code to make a custom train step: https://keras.io/guides/customizing_what_happens_in_fit/

I'd like to use this with tf.distribute.MultiWorkerMirroredStrategy. How should the loss be calculated if using a custom loss? As an example, let's say my custom loss is tf.keras.losses.SparseCategoricalCrossentropy. Should the reduction be set to tf.keras.losses.Reduction.NONE (like below)? Or do I need to set the reduction to tf.keras.losses.Reduction.SUM and divide by the global batch size?

My initial thought is to set the reduction to tf.keras.losses.Reduction.NONE. Then when I call model.fit, keras will automatically handle gradient aggregation across the replicas.

```<code>class CustomModel(tf.keras.Model):
    def __init__(self, model):
        super(CustomModel, self).__init__()
        self.model = model
        self.loss_tracker= tf.keras.metrics.Mean(name='loss')

    def train_step(self, data):
        x, y = data
        with tf.GradientTape() as tape:
            # Forward pass
            y_pred = self.model(x, training=True)
            # Compute our own loss. Shape (batch_size,)
            loss = tf.keras.losses.SparseCategoricalCrossentropy(
                from_logits = True, reduction=tf.keras.losses.Reduction.NONE)(y, y_pred)

        # Compute gradients
        trainable_vars = self.model.trainable_variables
        gradients = tape.gradient(loss, trainable_vars)
        # Update weights
        self.optimizer.apply_gradients(zip(gradients, trainable_vars))
        # Update metrics
        self.loss_tracker.update_state(loss)
        self.compiled_metrics.update_state(y, y_pred)
        metrics = {m.name: m.result() for m in self.metrics}
        return metrics
</code>```

Body:
I am using the following code to make a custom train step: https://keras.io/guides/customizing_what_happens_in_fit/

I'd like to use this with tf.distribute.MultiWorkerMirroredStrategy. How should the loss be calculated if using a custom loss? As an example, let's say my custom loss is tf.keras.losses.SparseCategoricalCrossentropy. Should the reduction be set to tf.keras.losses.Reduction.NONE (like below)? Or do I need to set the reduction to tf.keras.losses.Reduction.SUM and divide by the global batch size?

My initial thought is to set the reduction to tf.keras.losses.Reduction.NONE. Then when I call model.fit, keras will automatically handle gradient aggregation across the replicas.

class CustomModel(tf.keras.Model):
    def __init__(self, model):
        super(CustomModel, self).__init__()
        self.model = model
        self.loss_tracker= tf.keras.metrics.Mean(name='loss')

    def train_step(self, data):
        x, y = data
        with tf.GradientTape() as tape:
            # Forward pass
            y_pred = self.model(x, training=True)
            # Compute our own loss. Shape (batch_size,)
            loss = tf.keras.losses.SparseCategoricalCrossentropy(
                from_logits = True, reduction=tf.keras.losses.Reduction.NONE)(y, y_pred)

        # Compute gradients
        trainable_vars = self.model.trainable_variables
        gradients = tape.gradient(loss, trainable_vars)
        # Update weights
        self.optimizer.apply_gradients(zip(gradients, trainable_vars))
        # Update metrics
        self.loss_tracker.update_state(loss)
        self.compiled_metrics.update_state(y, y_pred)
        metrics = {m.name: m.result() for m in self.metrics}
        return metrics


问:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH (NodeJS)
I am using below NodeJS source code, to realize below two functions.

(1) Enable HTTPS/443
(2) When client sends URL with 'PATH' + 'QUERY STRING', response webpage should show the
'PATH' and 'QUERY STRING' value, which is same with client's request.

However, even though below source code is working well in my Windows CMD,
but when I accessed this server (with below source code), my client browser shows below error message.

Error message (client browser) :

This site can't provide a secure connection
jungkwan.biz uses an unsupported protocol
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Source Code :

```<code>var http = require('http');
var fs = require('fs');
var url = require('url');
var https = require('https');

var options ={
  pfx: fs.readFileSync('./jungkwan_biz.pfx'),
  passphrase: '123456789'
};

var app = https.createServer(function(request,response){
    var queryData = url.parse(request.url, true).query;
    var pathname = url.parse(request.url, true).pathname;
    var title1 = pathname;
    var title2 = queryData.name;
    var template = `
    Path : ${title1}
    Query String : name = ${title2}
    `
    response.end(template);
});

app.listen(443);
</code>```

Hello.
I am using below NodeJS source code, to realize below two functions.

(1) Enable HTTPS/443
(2) When client sends URL with 'PATH' + 'QUERY STRING', response webpage should show the
'PATH' and 'QUERY STRING' value, which is same with client's request.

However, even though below source code is working well in my Windows CMD,
but when I accessed this server (with below source code), my client browser shows below error message.

Error message (client browser) :

This site can't provide a secure connection
jungkwan.biz uses an unsupported protocol
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Source Code :

```<code>var http = require('http');
var fs = require('fs');
var url = require('url');
var https = require('https');

var options ={
  pfx: fs.readFileSync('./jungkwan_biz.pfx'),
  passphrase: '123456789'
};

var app = https.createServer(function(request,response){
    var queryData = url.parse(request.url, true).query;
    var pathname = url.parse(request.url, true).pathname;
    var title1 = pathname;
    var title2 = queryData.name;
    var template = `
    Path : ${title1}
    Query String : name = ${title2}
    `
    response.end(template);
});

app.listen(443);
</code>```
```<code></code>```

Body:
I am using below NodeJS source code, to realize below two functions.

(1) Enable HTTPS/443
(2) When client sends URL with 'PATH' + 'QUERY STRING', response webpage should show the
'PATH' and 'QUERY STRING' value, which is same with client's request.

However, even though below source code is working well in my Windows CMD,
but when I accessed this server (with below source code), my client browser shows below error message.

Error message (client browser) :

This site can't provide a secure connection
jungkwan.biz uses an unsupported protocol
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Source Code :

var http = require('http');
var fs = require('fs');
var url = require('url');
var https = require('https');

var options ={
  pfx: fs.readFileSync('./jungkwan_biz.pfx'),
  passphrase: '123456789'
};

var app = https.createServer(function(request,response){
    var queryData = url.parse(request.url, true).query;
    var pathname = url.parse(request.url, true).pathname;
    var title1 = pathname;
    var title2 = queryData.name;
    var template = `
    Path : ${title1}
    Query String : name = ${title2}
    `
    response.end(template);
});

app.listen(443);

Hello.
I am using below NodeJS source code, to realize below two functions.

(1) Enable HTTPS/443
(2) When client sends URL with 'PATH' + 'QUERY STRING', response webpage should show the
'PATH' and 'QUERY STRING' value, which is same with client's request.

However, even though below source code is working well in my Windows CMD,
but when I accessed this server (with below source code), my client browser shows below error message.

Error message (client browser) :

This site can't provide a secure connection
jungkwan.biz uses an unsupported protocol
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Source Code :

var http = require('http');
var fs = require('fs');
var url = require('url');
var https = require('https');

var options ={
  pfx: fs.readFileSync('./jungkwan_biz.pfx'),
  passphrase: '123456789'
};

var app = https.createServer(function(request,response){
    var queryData = url.parse(request.url, true).query;
    var pathname = url.parse(request.url, true).pathname;
    var title1 = pathname;
    var title2 = queryData.name;
    var template = `
    Path : ${title1}
    Query String : name = ${title2}
    `
    response.end(template);
});

app.listen(443);


问:
Should I use a GraphServiceClient per set of client credentials or can I reuse the same GraphServiceClient with different credentials?
I know you generally want to reuse GraphServiceClient like HttpClient, but what should I do if I need to use two or more different Azure AD Client ID/Client Secret combinations in the same daemon application?

Should I create a singleton GraphServiceClient for each set of credentials? If so, would I need to register some sort of factory class for dependency injection of the correct GraphServiceClient?

Or is there a way to use different client credentials with the same GraphServiceClient instance?


问:
why can't run pyspider on macos, my environment is python3.8
```<code>(demo_pyspider_1) x###:demo_pyspider_1 x###$ pyspider all
Traceback (most recent call last):
pa"/Volumes/D/anaconda3/anaconda3/envs/demo_pyspider_1/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function cli at 0x7ff5d6cfd0d0>: it's not the same object as pyspider.run.cli

</code>```

all of software is installed by pip-tool, but can't run normally.

i want to open pyspider webui. thanks for u answer

Body:
(demo_pyspider_1) x###:demo_pyspider_1 x###$ pyspider all
Traceback (most recent call last):
pa"/Volumes/D/anaconda3/anaconda3/envs/demo_pyspider_1/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function cli at 0x7ff5d6cfd0d0>: it's not the same object as pyspider.run.cli

all of software is installed by pip-tool, but can't run normally.

i want to open pyspider webui. thanks for u answer


问:
Angular Material Dialog with Google Places Autocomplete dropdown positioning
I have a web page that uses the Angular framework and therefore the Materials UI library. I have a dialog with a form that uses the Google Places Autocomplete functionality, but the positioning of it stays constant when scrolling through the dialog. Without the dialog, the autocomplete positioning works as I would like and stays directly beneath the input. No styling on the .pac-container has been done for the positioning. The dialog and non-dialog have the same code and styling. Thank you in advance! (Mind the ugliness, it is all testing right now)

google.maps.places.Autocomplete position offset inside angular material Dialog is the exact issue I am having (I think), but I do not know what is meant by "My solution was to remove the top style and then restore it."

Initial position of autocomplete in the dialog

Autocomplete position when scrolling through the dialog

Initial position of autocomplete outside dialog

Autocomplete position when scrolling outside dialog

Non-Dialog TS:

```<code>export class AddressTestComponent implements OnInit, AfterViewInit {

    @ViewChild("addressLine1") addressField1: ElementRef;
    @ViewChild("addressLine2") addressField2: ElementRef;
    @ViewChild(MatAutocompleteTrigger, {static: false}) trigger: MatAutocompleteTrigger;
    addressForm: UntypedFormGroup;

    googleAutocomplete: google.maps.places.Autocomplete;

    constructor(private formBuilder: UntypedFormBuilder) { }

    ngOnInit(): void {
        this.addressForm = this.formBuilder.group(
            {
                addressLine1: ['', Validators.required],
                addressLine2: [''],
                city: ['', Validators.required],
                state: ['', Validators.required],
                zipCode: ['', Validators.required],
                country: ['', Validators.required],
            }
        );
    }

    ngAfterViewInit(): void {
        this.googleAutocomplete = new google.maps.places.Autocomplete(this.addressField1.nativeElement as HTMLInputElement, {
            componentRestrictions: { country: ["us"] },
            fields: ["address_components"],
            types: ["address"]
        });

        this.addressField1.nativeElement.focus();
        this.googleAutocomplete.addListener("place_changed", () => this.autocomplete(this.googleAutocomplete.getPlace()) );

    }
}
</code>```

Non-Dialog HTML:

```<code><div>
    <div class="dialog-header">
        <h2>Add a New Address</h2>
        <h2 class="header-closer" (click)="onClose()" >X</h2>
    </div>
    <form [formGroup]="addressForm" (ngSubmit)="onSubmitNewAddress()" class="address-form">
        <div class="address-wrapper">
            <mat-form-field (keydown.escape)="$event.stopPropagation()"
                appearance="fill">
                <mat-label>Address Line 1</mat-label>
                <input matInput #addressLine1 formControlName="addressLine1" required>
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>Address Line 2 (Optional)</mat-label>
                <input matInput #addressLine2 formControlName="addressLine2">
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>City</mat-label>
                <input matInput formControlName="city" required>
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>State</mat-label>
                <input matInput formControlName="state" required>
            </mat-form-field>
            <mat-form-field appearance="fill" style="margin-bottom: 10px;">
                <mat-label>Zip Code</mat-label>
                <mat-hint align="end">{{ zipcode.value.length }} / 5</mat-hint>
                <input matInput #zipcode type="tel" [maxLength]="5" formControlName="zipCode" required>
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>Country</mat-label>
                <input matInput formControlName="country" required>
            </mat-form-field>
        </div>
        <div class="form-buttons">
            <button mat-raised-button (click)="onClose()">Cancel</button>
            <button mat-raised-button color="primary" type="submit" [disabled]="this.addressForm.invalid">Use This Address</button>
        </div>
    </form>
</div>
</code>```

Non-Dialog SCSS:

```<code>.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

#map {
    height: 100%;
}

.address-form {
    padding-bottom: 2000px; // for scrolling test
}

.header-closer {
    cursor: pointer;
    color: red;
    margin-top: 30px;
}

.address-wrapper {
    display: flex;
    flex-wrap: wrap;

    mat-form-field {
        margin: 0 15px;
        flex: 1;
    }
}

.form-buttons {

    button {
        margin: 0 5px;
    }

    button:hover {
        background-color: #771f1f;
    }
}
</code>```

I have tried the autocomplete without a Material Dialog and it works just as intended and how I would like it to work. I am just trying to replicate that while scrolling through the dialog as well. To fix the issue, I tried to change the position styling of .pac-container but was unsuccessful.

EDIT: I figured out what the other stackoverflow link was talking about. Is there a way the autocomplete styling can be tied to the actual input element rather than the html tag?

Body:
I have a web page that uses the Angular framework and therefore the Materials UI library. I have a dialog with a form that uses the Google Places Autocomplete functionality, but the positioning of it stays constant when scrolling through the dialog. Without the dialog, the autocomplete positioning works as I would like and stays directly beneath the input. No styling on the .pac-container has been done for the positioning. The dialog and non-dialog have the same code and styling. Thank you in advance! (Mind the ugliness, it is all testing right now)

google.maps.places.Autocomplete position offset inside angular material Dialog is the exact issue I am having (I think), but I do not know what is meant by "My solution was to remove the top style and then restore it."

Initial position of autocomplete in the dialog

Autocomplete position when scrolling through the dialog

Initial position of autocomplete outside dialog

Autocomplete position when scrolling outside dialog

Non-Dialog TS:

export class AddressTestComponent implements OnInit, AfterViewInit {

    @ViewChild("addressLine1") addressField1: ElementRef;
    @ViewChild("addressLine2") addressField2: ElementRef;
    @ViewChild(MatAutocompleteTrigger, {static: false}) trigger: MatAutocompleteTrigger;
    addressForm: UntypedFormGroup;

    googleAutocomplete: google.maps.places.Autocomplete;

    constructor(private formBuilder: UntypedFormBuilder) { }

    ngOnInit(): void {
        this.addressForm = this.formBuilder.group(
            {
                addressLine1: ['', Validators.required],
                addressLine2: [''],
                city: ['', Validators.required],
                state: ['', Validators.required],
                zipCode: ['', Validators.required],
                country: ['', Validators.required],
            }
        );
    }

    ngAfterViewInit(): void {
        this.googleAutocomplete = new google.maps.places.Autocomplete(this.addressField1.nativeElement as HTMLInputElement, {
            componentRestrictions: { country: ["us"] },
            fields: ["address_components"],
            types: ["address"]
        });

        this.addressField1.nativeElement.focus();
        this.googleAutocomplete.addListener("place_changed", () => this.autocomplete(this.googleAutocomplete.getPlace()) );

    }
}

Non-Dialog HTML:

Add a New Address

X

    <form [formGroup]="addressForm" (ngSubmit)="onSubmitNewAddress()" class="address-form">

            <mat-form-field (keydown.escape)="$event.stopPropagation()"
                appearance="fill">
                <mat-label>Address Line 1</mat-label>
                <input matInput #addressLine1 formControlName="addressLine1" required>
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>Address Line 2 (Optional)</mat-label>
                <input matInput #addressLine2 formControlName="addressLine2">
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>City</mat-label>
                <input matInput formControlName="city" required>
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>State</mat-label>
                <input matInput formControlName="state" required>
            </mat-form-field>
            <mat-form-field appearance="fill" style="margin-bottom: 10px;">
                <mat-label>Zip Code</mat-label>
                <mat-hint align="end">{{ zipcode.value.length }} / 5</mat-hint>
                <input matInput #zipcode type="tel" [maxLength]="5" formControlName="zipCode" required>
            </mat-form-field>
            <mat-form-field appearance="fill">
                <mat-label>Country</mat-label>
                <input matInput formControlName="country" required>
            </mat-form-field>

            <button mat-raised-button (click)="onClose()">Cancel</button>
            <button mat-raised-button color="primary" type="submit" [disabled]="this.addressForm.invalid">Use This Address</button>

    </form>

Non-Dialog SCSS:

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

#map {
    height: 100%;
}

.address-form {
    padding-bottom: 2000px; // for scrolling test
}

.header-closer {
    cursor: pointer;
    color: red;
    margin-top: 30px;
}

.address-wrapper {
    display: flex;
    flex-wrap: wrap;

    mat-form-field {
        margin: 0 15px;
        flex: 1;
    }
}

.form-buttons {

    button {
        margin: 0 5px;
    }

    button:hover {
        background-color: #771f1f;
    }
}

I have tried the autocomplete without a Material Dialog and it works just as intended and how I would like it to work. I am just trying to replicate that while scrolling through the dialog as well. To fix the issue, I tried to change the position styling of .pac-container but was unsuccessful.

EDIT: I figured out what the other stackoverflow link was talking about. Is there a way the autocomplete styling can be tied to the actual input element rather than the html tag?


问:
GridView Inline editing show custom cell text differ from database table value
I have database table below

```<code> Id    Status
  1      0
  2      1
</code>```

In my gridview, I need show 0 as Disable while 1 is Enable.  I can do this in RowDataBound handler

```<code>   If (e.Row.RowType = DataControlRowType.DataRow) Then
        If (e.Row.Cells(1).Text = "1") Then
            e.Row.Cells(1).Text = "Enable"
        Else
           e.Row.Cells(1).Text = "Disable"
        End If
    End If
</code>```

My gridview is using BoudColumn.  When I do an inline editing, I'm not able to show a textbox for the Status column to let user key in Enable/Disable.  Suspect because the cell value change and not match the original value 0/1.  If I not change the cell value and remain display 0/1 as what from datatbase, it show a text box for user to key in.

How I can show a custom value in the cell and at the same time when user do inline edit; it still show up the text box let user key in Disable/Enable?

Body:
I have database table below

 Id    Status
  1      0
  2      1

In my gridview, I need show 0 as Disable while 1 is Enable.  I can do this in RowDataBound handler

   If (e.Row.RowType = DataControlRowType.DataRow) Then
        If (e.Row.Cells(1).Text = "1") Then
            e.Row.Cells(1).Text = "Enable"
        Else
           e.Row.Cells(1).Text = "Disable"
        End If
    End If

My gridview is using BoudColumn.  When I do an inline editing, I'm not able to show a textbox for the Status column to let user key in Enable/Disable.  Suspect because the cell value change and not match the original value 0/1.  If I not change the cell value and remain display 0/1 as what from datatbase, it show a text box for user to key in.

How I can show a custom value in the cell and at the same time when user do inline edit; it still show up the text box let user key in Disable/Enable?


问:
How to set gitlab environment based on rules?
I have a job in gitlab ci/cd defined:

```<code>authenticate:

stage: authenticate
  image: google/cloud-sdk:debian_component_based
  variables:
    ENVIRONMENT: staging
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      when: always
      variables:
        ENVIRONMENT: production
    - if: $CI_COMMIT_BRANCH == "staging"
      when: always
      variables:
        ENVIRONMENT: staging
    - if: $CI_COMMIT_BRANCH == "development"
      when: always
      variables:
        ENVIRONMENT: development
  environment:
    name: $ENVIRONMENT
</code>```

I cannot set gitlab environment, because when i push to development branch, $CI_ENVIRONMENT_NAME is staging instead of development

Body:
I have a job in gitlab ci/cd defined:

authenticate:

stage: authenticate
  image: google/cloud-sdk:debian_component_based
  variables:
    ENVIRONMENT: staging
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
      when: always
      variables:
        ENVIRONMENT: production
    - if: $CI_COMMIT_BRANCH == "staging"
      when: always
      variables:
        ENVIRONMENT: staging
    - if: $CI_COMMIT_BRANCH == "development"
      when: always
      variables:
        ENVIRONMENT: development
  environment:
    name: $ENVIRONMENT

I cannot set gitlab environment, because when i push to development branch, $CI_ENVIRONMENT_NAME is staging instead of development


问:
How do you prevent 'react-scripts build' from minifying certain pieces of code?
Setup: node react app with TurnstoneSearch plugin

So the issue is that when I run

```<code>npm run build
</code>```

it breaks the functionality of my searchbar in my app. I figure it is because during the webpack minification process that

```<code>react-scripts build
</code>```

broke turnstone's functionality somehow.

I'm wondering if anyone knows of a way I can just stop the turnstone code from minifying so that it functions properly.

I tried to look into the webpack script that is invoked, but I don't know where to begin. There is a method to turn off all minification but that defeats the purpose of building for production...

Body:
Setup: node react app with TurnstoneSearch plugin

So the issue is that when I run

npm run build

it breaks the functionality of my searchbar in my app. I figure it is because during the webpack minification process that

react-scripts build

broke turnstone's functionality somehow.

I'm wondering if anyone knows of a way I can just stop the turnstone code from minifying so that it functions properly.

I tried to look into the webpack script that is invoked, but I don't know where to begin. There is a method to turn off all minification but that defeats the purpose of building for production...


问:
Handling Unique connections in FastAPI
Hi guys I have a backend that a user provides their credentials into and the backend logs into another system with those credentials. When a user calles an endpoint the correct credentials needs to be used. What is the correct way of doing this ?

What I have right now is a user logs in I store the credentials somewhere I sign a jwt with their username. When they call an endpoint I check the username and use their credentials.

The other system is proxmox and I'm using proxmoxer to connect to it. I need access to the proxmox API WITH the user's permission so no single token.

Title: Handling Unique connections in FastAPI


问:
Converting then matching date types in VBA
I am creating a button macro in excel using VBA. The gist of it is that I have a date in Sheet1 of format yymmdd, and a row of dates in Sheet2 that I need to match it with.

Input date:

Date lookup:

At the moment, I have the following VBA code running when I click a button in Sheet1:

```<code>Sub Button3_Click()
    Dim dateInput As String
    Dim fmtDate As Date, yr As String, mo As String, da As String
    Dim dates As Range
    Dim dateMatch As Range
    ' Convert the date in B7 to dd/mm/yyyy format
    dateInput = Worksheets("22-23 AP2 report").Range("B7").Value

    yr = "20" & Left(dateInput, 2)
    mo = Mid(dateInput, 3, 2)
    da = Right(dateInput, 1)
    fmtDate = DateSerial(yr, mo, da)

    Debug.Print fmtDate

    ' Find the corresponding column to the date in Hrs comparison
    Set dates = Worksheets("Hrs comparison").Range("C2").End(xlToRight)
    Set dateMatch = dates.Find(fmtDate)

    If dateMatch Is Nothing Then
        MsgBox "The date could not be found in the Hrs comparison sheet"
    Else
        Dim leftmostColumn As Integer
        leftmostColumn = dateMatch.Column

        ' Reference the leftmost column in the Hrs comparison sheet
        Dim leftmostColumnRange As Range
        Set leftmostColumnRange = Worksheets("Hrs comparison").Columns(leftmostColumn)

        ' Do something with the leftmost column range, for example:
        Debug.Print leftmostColumnRange.Address
    End If
End Sub
</code>```

Ideally, the code would return the leftmost column of the matching date in Sheet2 (notice the columns are merged), however, it cannot seem to find a direct match. The Debug.Print fmtDate line correctly prints 2/12/2022, and I have also tried wrapping it with CDate(), to no avail.

Body:
I am creating a button macro in excel using VBA. The gist of it is that I have a date in Sheet1 of format yymmdd, and a row of dates in Sheet2 that I need to match it with.

Input date:

Date lookup:

At the moment, I have the following VBA code running when I click a button in Sheet1:

Sub Button3_Click()
    Dim dateInput As String
    Dim fmtDate As Date, yr As String, mo As String, da As String
    Dim dates As Range
    Dim dateMatch As Range
    ' Convert the date in B7 to dd/mm/yyyy format
    dateInput = Worksheets("22-23 AP2 report").Range("B7").Value

    yr = "20" & Left(dateInput, 2)
    mo = Mid(dateInput, 3, 2)
    da = Right(dateInput, 1)
    fmtDate = DateSerial(yr, mo, da)

    Debug.Print fmtDate

    ' Find the corresponding column to the date in Hrs comparison
    Set dates = Worksheets("Hrs comparison").Range("C2").End(xlToRight)
    Set dateMatch = dates.Find(fmtDate)

    If dateMatch Is Nothing Then
        MsgBox "The date could not be found in the Hrs comparison sheet"
    Else
        Dim leftmostColumn As Integer
        leftmostColumn = dateMatch.Column

        ' Reference the leftmost column in the Hrs comparison sheet
        Dim leftmostColumnRange As Range
        Set leftmostColumnRange = Worksheets("Hrs comparison").Columns(leftmostColumn)

        ' Do something with the leftmost column range, for example:
        Debug.Print leftmostColumnRange.Address
    End If
End Sub

Ideally, the code would return the leftmost column of the matching date in Sheet2 (notice the columns are merged), however, it cannot seem to find a direct match. The Debug.Print fmtDate line correctly prints 2/12/2022, and I have also tried wrapping it with CDate(), to no avail.


问:
How to force to show every class tag during XML serialisation in C#
I have the following console program

using System.Xml;
using System.Xml.Serialization;

namespace myTry {
  public class CI_ResponsibleParty{

    public CI_ResponsibleParty() { }

    [XmlElement(Order = 0, ElementName = "individualName")]
    public string IndividualName { get; set; }

    [XmlElement(Order = 1, ElementName = "contactInfo")]
    public CI_Contact ContactInfo {  get; set; }

  }
  public class CI_Contact{
    public CI_Contact() {}

    [XmlElement(Order = 1, ElementName = "address")]
    public CI_Address Address { get; set; }
  }
  public class CI_Address{

    public CI_Address() {}

    [XmlArray(ElementName = "deliveryPoint", Order = 0)]
    [XmlArrayItem(typeof(string), ElementName = "CharacterString", Type = typeof(string))]
    public List<string> DeliveryPoint { get; set; }

    [XmlElement(Order = 1, ElementName = "city")]
    public string City { get; set; }

    [XmlAttribute(DataType = "ID", AttributeName = "id")]
    public string Id { get; set; }

    [XmlAttribute(AttributeName = "uuid")]
    public string Uuid { get; set; }

  }

}

namespace Application {

  class Program {
    public static void ReadXML() {

      var b = new myTry.CI_ResponsibleParty() {
        IndividualName = "dummy ind name",
        ContactInfo = new myTry.CI_Contact {

          Address = new myTry.CI_Address {
            Id = "123",
            Uuid = "123",
            City = "dummuy city",
          }
        }
      };

      var writer = new System.Xml.Serialization.XmlSerializer(typeof(myTry.CI_ResponsibleParty));
      var wfile = new System.IO.StreamWriter(@"CI_ResponsibleParty_write.xml");
      writer.Serialize(wfile, b);
      wfile.Close();
      return;

    }
    static void Main(string[] args) {
      ReadXML();
    }
  }
}
```
<p>it produces</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8"?>
<CI_ResponsibleParty xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <individualName>dummy ind name</individualName>
  <contactInfo>
    <address id="123" uuid="123">
      <city>dummuy city</city>
    </address>
  </contactInfo>
</CI_ResponsibleParty>
</code>```

but I want to have CI_Contact and CI_Address tags as inner tags of contaxtInfo and address tags respectively. i.e.

<?xml version="1.0" encoding="utf-8"?>
<CI_ResponsibleParty xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <individualName>dummy ind name</individualName>
  <contactInfo>
    <CI_Contact>
      <address id="123" uuid="123">
        <CI_Address>
          <city>dummuy city</city>
        </CI_Address>
      </address>
    </CI_Contact>
  </contactInfo>
</CI_ResponsibleParty>
```

How may I do so? What did I do wrong?

Body:
I have the following console program

using System.Xml;
using System.Xml.Serialization;

namespace myTry {
  public class CI_ResponsibleParty{

    public CI_ResponsibleParty() { }

    [XmlElement(Order = 0, ElementName = "individualName")]
    public string IndividualName { get; set; }

    [XmlElement(Order = 1, ElementName = "contactInfo")]
    public CI_Contact ContactInfo {  get; set; }

  }
  public class CI_Contact{
    public CI_Contact() {}

    [XmlElement(Order = 1, ElementName = "address")]
    public CI_Address Address { get; set; }
  }
  public class CI_Address{

    public CI_Address() {}

    [XmlArray(ElementName = "deliveryPoint", Order = 0)]
    [XmlArrayItem(typeof(string), ElementName = "CharacterString", Type = typeof(string))]
    public List<string> DeliveryPoint { get; set; }

    [XmlElement(Order = 1, ElementName = "city")]
    public string City { get; set; }

    [XmlAttribute(DataType = "ID", AttributeName = "id")]
    public string Id { get; set; }

    [XmlAttribute(AttributeName = "uuid")]
    public string Uuid { get; set; }

  }

}

namespace Application {

  class Program {
    public static void ReadXML() {

      var b = new myTry.CI_ResponsibleParty() {
        IndividualName = "dummy ind name",
        ContactInfo = new myTry.CI_Contact {

          Address = new myTry.CI_Address {
            Id = "123",
            Uuid = "123",
            City = "dummuy city",
          }
        }
      };

      var writer = new System.Xml.Serialization.XmlSerializer(typeof(myTry.CI_ResponsibleParty));
      var wfile = new System.IO.StreamWriter(@"CI_ResponsibleParty_write.xml");
      writer.Serialize(wfile, b);
      wfile.Close();
      return;

    }
    static void Main(string[] args) {
      ReadXML();
    }
  }
}

it produces

<?xml version="1.0" encoding="utf-8"?>
<CI_ResponsibleParty xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <individualName>dummy ind name</individualName>
  <contactInfo>
    <address id="123" uuid="123">
      <city>dummuy city</city>
    </address>
  </contactInfo>
</CI_ResponsibleParty>

but I want to have CI_Contact and CI_Address tags as inner tags of contaxtInfo and address tags respectively. i.e.

<?xml version="1.0" encoding="utf-8"?>
<CI_ResponsibleParty xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <individualName>dummy ind name</individualName>
  <contactInfo>
    <CI_Contact>
      <address id="123" uuid="123">
        <CI_Address>
          <city>dummuy city</city>
        </CI_Address>
      </address>
    </CI_Contact>
  </contactInfo>
</CI_ResponsibleParty>

How may I do so? What did I do wrong?


问:
How to map Java Thread to OS Thread on Linux？
I'm trying to map Java Thread to OS thread within JVMTI. In JVMTI, all I could grab is Java Thread object leveraging GetCurrentThread. But I want to know which OS thread this jthread is mapping to.

I was told that there is a field in Hotspot, eetop, which is a pointer to the underlying OS-level native thread instance of the JVM(ref: hotspot/src/share/vm/classfile/javaClasses.cpp).

How do I use this field to finish the mapping?

This magic is also being performed in async-profiler at src/vmStructs.cpp line 364. Why it works?