问:
Curl not working at Dockerfile entrypoint: Connection refused
I am trying to execute a shell script to call the Grafana API on startup, specifically:

```<code>curl -X POST -H "Content-Type: application/json" -d '{"name":"Algo Quant"}' http://admin:admin@grafana:3000/api/orgs
</code>```

However when I do this I am getting the following error:
curl: (7) Failed to connect to grafana port 3000: Connection refused

My compose file:

```<code>version: '3.7'
services:
  grafana-bootstrap-pre:
    build:
      context: $PWD
      dockerfile: .hack/build/docker/pre/Dockerfile
    env_file:
    - $PWD/config/__envrc.d/grafana-bootstrap-pre.envrcd
    volumes:
    - $PWD/config/_ops_monitoring_grafana/provisioning.initial/:/etc/grafana/provisioning/provisioning.initial/
    - $PWD/config/_ops_monitoring_grafana/provisioning/current/:/etc/grafana/provisioning/current/
  grafana:
      image: grafana/grafana:9.2.3
      ports:
        - 3000:3000
      restart: unless-stopped
      volumes:
        - _volume__ops_monitoring_grafana:/var/lib/grafana
        - $PWD/config/plugins/:/var/lib/grafana/plugins/
        - $PWD/config/_ops_monitoring_grafana/provisioning/current/:/etc/grafana/provisioning/
        #- $PWD/config/_ops_monitoring_grafana/grafana.ini:/etc/grafana/grafana.ini
      depends_on:
      - "grafana-bootstrap-pre"
  grafana-bootstrap-post:
    build:
      context: $PWD
      dockerfile: .hack/build/docker/post/Dockerfile
    env_file:
    - $PWD/config/__envrc.d/grafana-bootstrap-post.envrcd
    volumes:
    - $PWD/config/_ops_monitoring_grafana/provisioning.default/:/etc/grafana/provisioning/provisioning.default/
    - $PWD/config/_ops_monitoring_grafana/provisioning/current/:/etc/grafana/provisioning/current/
    depends_on:
      - "grafana"

volumes:
  _volume__ops_monitoring_grafana: {}

networks:
  default:
    external:
      name: services-network
</code>```

My dockerfile for the offending container (post):

```<code>FROM ubuntu:20.04

COPY config/scripts/bootstrap.sh .

RUN apt-get update
RUN apt-get -y install curl

ENTRYPOINT ["/bin/bash","./bootstrap.sh", "--run"]
</code>```

Which calls the following function:

```<code>curl -X POST -H "Content-Type: application/json" -d '{"name":"Algo Quant"}' http://admin:admin@grafana:3000/api/orgs
</code>```

The strange thing which I cannot work out is that if i do this:

```<code>docker exec -it grafana-bootstrap-post-1 sh
</code>```

Then execute the curl command here then I get the correct response.

Body:
I am trying to execute a shell script to call the Grafana API on startup, specifically:

curl -X POST -H "Content-Type: application/json" -d '{"name":"Algo Quant"}' http://admin:admin@grafana:3000/api/orgs

However when I do this I am getting the following error:
curl: (7) Failed to connect to grafana port 3000: Connection refused

My compose file:

version: '3.7'
services:
  grafana-bootstrap-pre:
    build:
      context: $PWD
      dockerfile: .hack/build/docker/pre/Dockerfile
    env_file:
    - $PWD/config/__envrc.d/grafana-bootstrap-pre.envrcd
    volumes:
    - $PWD/config/_ops_monitoring_grafana/provisioning.initial/:/etc/grafana/provisioning/provisioning.initial/
    - $PWD/config/_ops_monitoring_grafana/provisioning/current/:/etc/grafana/provisioning/current/
  grafana:
      image: grafana/grafana:9.2.3
      ports:
        - 3000:3000
      restart: unless-stopped
      volumes:
        - _volume__ops_monitoring_grafana:/var/lib/grafana
        - $PWD/config/plugins/:/var/lib/grafana/plugins/
        - $PWD/config/_ops_monitoring_grafana/provisioning/current/:/etc/grafana/provisioning/
        #- $PWD/config/_ops_monitoring_grafana/grafana.ini:/etc/grafana/grafana.ini
      depends_on:
      - "grafana-bootstrap-pre"
  grafana-bootstrap-post:
    build:
      context: $PWD
      dockerfile: .hack/build/docker/post/Dockerfile
    env_file:
    - $PWD/config/__envrc.d/grafana-bootstrap-post.envrcd
    volumes:
    - $PWD/config/_ops_monitoring_grafana/provisioning.default/:/etc/grafana/provisioning/provisioning.default/
    - $PWD/config/_ops_monitoring_grafana/provisioning/current/:/etc/grafana/provisioning/current/
    depends_on:
      - "grafana"

volumes:
  _volume__ops_monitoring_grafana: {}

networks:
  default:
    external:
      name: services-network

My dockerfile for the offending container (post):

FROM ubuntu:20.04

COPY config/scripts/bootstrap.sh .

RUN apt-get update
RUN apt-get -y install curl

ENTRYPOINT ["/bin/bash","./bootstrap.sh", "--run"]

Which calls the following function:

curl -X POST -H "Content-Type: application/json" -d '{"name":"Algo Quant"}' http://admin:admin@grafana:3000/api/orgs

The strange thing which I cannot work out is that if i do this:

docker exec -it grafana-bootstrap-post-1 sh

Then execute the curl command here then I get the correct response.


来源: stackexchange

问:
Uncaught TypeError: Cannot read properties of null (reading 'useState')and The above error occurred in the <ChatEngineWrapper> component:
iam getting 3 errors in my console
1.Uncaught TypeError: Cannot read properties of null (reading 'useState')
2.The above error occurred in the  component:
3.Get or create chat error TypeError: Cannot read properties of null (reading 'useState')

Below is the code where i used ChatEngineWrapper:

```<code>import React, { useEffect, useState } from "react";

import { ChatEngineWrapper, Socket, ChatFeed } from 'react-chat-engine'

const ChatEngine = props => {
    const [showChat, setShowChat] = useState(false)

    useEffect(() => {
        if (props.visible) {
            setTimeout(() => {
                setShowChat(true)
            }, 500)
        }
    })

    return (
        <div
            className='transition-5'
            style={{
                ...styles.chatEngineWindow,
                ...{
                    height: props.visible ? '100%' : '0px',
                    zIndex: props.visible ? '100' : '0',
                    width: '100%',
                    backgroundColor:'white'
                }
            }}
        >
            {
                props.visible &&
                <ChatEngineWrapper>
                    <Socket
                        projectID={process.env.REACT_APP_CE_PROJECT_ID}
                        userName={props.user.email}
                        userSecret={props.user.email}
                    />
                    <ChatFeed activeChat={props.chat.id} />
                </ChatEngineWrapper>
            }
        </div>
    )
}

export default ChatEngine;
</code>```

below is the code where iam creating user and chat

```<code>import React, { useState } from "react"
import axios from 'axios'

import { styles } from "../styles"

import Avatar from '../Avatar'

const EmailForm = props => {
    const [email, setEmail] = useState('')
    const [loading, setLoading] = useState(false)

    function getOrCreateUser(callback) {
        axios.put(
            'https://api.chatengine.io/users/',
            {username: email, email: email, secret: email},
            {headers: {"Private-Key": process.env.REACT_APP_CE_PRIVATE_KEY}}
        )
        .then(r => callback(r.data))
        .catch(e => console.log('Get or create user error', e))
    }

    function getOrCreateChat(callback) {
        axios.put(
            'https://api.chatengine.io/chats/',
            {usernames: [email, 'HAMSHEENA'], is_direct_chat: true},
            {headers: {"Private-Key": process.env.REACT_APP_CE_PRIVATE_KEY}}
        )
        .then(r => callback(r.data))
        .catch(e => console.log('Get or create chat error', e))
    }

    function handleSubmit(event) {
        event.preventDefault();

        console.log('Sending Email', email)
        getOrCreateUser(
            user => {
                 props.setUser(user)
                getOrCreateChat(chat => {

                     props.setChat(chat)
                })
            }
        )
    }

    return (
        <div
            style={{
                ...styles.emailFormWindow,
                ...{
                    height: props.visible ? '100%' : '0px',
                    opacity: props.visible ? '1' : '0'
                }
            }}
        >
            <div style={{ height: '0px' }}>
                <div style={styles.stripe} />
            </div>

            <div
                className='transition-5'
                style={{
                    ...styles.loadingDiv,
                    ...{
                        zIndex: loading ? '10' : '-1',
                        opacity: loading ? '0.33' : '0',
                    }
                }}
            />

            <div style={{ position: 'absolute', height: '1%', width: '100%', textAlign: 'center' }}>
                <Avatar
                    style={{
                        position: 'relative',
                        left: 'calc(50% - 44px)',
                        top: '10%',
                    }}
                />

                <div style={styles.topText}>
                    Welcome to  <br /> programming support
                </div>

                <form
                    onSubmit={e => handleSubmit(e)}
                    style={{ position: 'relative', width: '100%', top: '19.75%' }}
                >
                    <input
                        placeholder='Your Email'
                        onChange={e => setEmail(e.target.value)}
                        style={styles.emailInput}
                    />
                </form>

                <div style={styles.bottomText}>
                    Enter your email <br /> to get started.
                </div>
            </div>
        </div>
    )
}

export default EmailForm;
</code>```

User is getting created inside chatEngine but chat window is not displaying in UI

ContentLicense: CC BY-SA 4.0

Body:
iam getting 3 errors in my console
1.Uncaught TypeError: Cannot read properties of null (reading 'useState')
2.The above error occurred in the  component:
3.Get or create chat error TypeError: Cannot read properties of null (reading 'useState')

Below is the code where i used ChatEngineWrapper:

import React, { useEffect, useState } from "react";

import { ChatEngineWrapper, Socket, ChatFeed } from 'react-chat-engine'

const ChatEngine = props => {
    const [showChat, setShowChat] = useState(false)

    useEffect(() => {
        if (props.visible) {
            setTimeout(() => {
                setShowChat(true)
            }, 500)
        }
    })

    return (

            {
                props.visible &&
                <ChatEngineWrapper>
                    <Socket
                        projectID={process.env.REACT_APP_CE_PROJECT_ID}
                        userName={props.user.email}
                        userSecret={props.user.email}
                    />
                    <ChatFeed activeChat={props.chat.id} />
                </ChatEngineWrapper>
            }

    )
}

export default ChatEngine;

below is the code where iam creating user and chat

import React, { useState } from "react"
import axios from 'axios'

import { styles } from "../styles"

import Avatar from '../Avatar'

const EmailForm = props => {
    const [email, setEmail] = useState('')
    const [loading, setLoading] = useState(false)

    function getOrCreateUser(callback) {
        axios.put(
            'https://api.chatengine.io/users/',
            {username: email, email: email, secret: email},
            {headers: {"Private-Key": process.env.REACT_APP_CE_PRIVATE_KEY}}
        )
        .then(r => callback(r.data))
        .catch(e => console.log('Get or create user error', e))
    }

    function getOrCreateChat(callback) {
        axios.put(
            'https://api.chatengine.io/chats/',
            {usernames: [email, 'HAMSHEENA'], is_direct_chat: true},
            {headers: {"Private-Key": process.env.REACT_APP_CE_PRIVATE_KEY}}
        )
        .then(r => callback(r.data))
        .catch(e => console.log('Get or create chat error', e))
    }

    function handleSubmit(event) {
        event.preventDefault();

        console.log('Sending Email', email)
        getOrCreateUser(
            user => {
                 props.setUser(user)
                getOrCreateChat(chat => {

                     props.setChat(chat)
                })
            }
        )
    }

    return (

                <Avatar
                    style={{
                        position: 'relative',
                        left: 'calc(50% - 44px)',
                        top: '10%',
                    }}
                />

                    Welcome to
 programming support

                <form
                    onSubmit={e => handleSubmit(e)}
                    style={{ position: 'relative', width: '100%', top: '19.75%' }}
                >
                    <input
                        placeholder='Your Email'
                        onChange={e => setEmail(e.target.value)}
                        style={styles.emailInput}
                    />
                </form>

                    Enter your email
 to get started.

    )
}

export default EmailForm;

User is getting created inside chatEngine but chat window is not displaying in UI


问:
i18next.init() does not complete when using i18next-resources-to-backend with lazy load to FileReader
I seem to have a strange issue, where the 'ready' callback is not triggering when using resourcesToBackend in lazy load mode.

My code runs as follows and the language files are available on the path.
console.log also reports that the language / namespace dictionaries have loaded.

```<code>import i18next from 'i18next';
import i18nextBrowserLanguageDetector from 'i18next-browser-languagedetector';
import i18nextSprintfPostProcessor from 'i18next-sprintf-postprocessor';
import i18nextResourcesToBackend from 'i18next-resources-to-backend'

i18next.use(i18nextBrowserLanguageDetector).use(i18nextResourcesToBackend((language, namespace)=>{
      return new Promise(function(resolve, reject) {
         MyFsReadFile(`i18n/${language}/${namespace}.json`, (file)=>{
           const reader = new FileReader();
           reader.onload = (ev)=>{ resolve(JSON.parse(ev.target.result)) };
           reader.readAsText(file);
         }), (error)=>{
           if(process.env.NODE_ENV !== 'production') console.log('i18nextResourcesToBackend error', language, namespace, error);
           reject(error);
         }
      });
    })).use(i18nextSprintfPostProcessor)
  .init({
    fallbackLng: 'en',
    debug: process.env.NODE_ENV !== 'production',
    ns: ['app','test','core'], defaultNS: 'app', fallbackNS: 'core',
    overloadTranslationOptionHandler: i18nextSprintfPostProcessor.overloadTranslationOptionHandler
  }, (err, t)=> {

// this is never called ..!
  });

</code>```

The strange thing is that the use of this configuration using the standard i18next-http-backend plugin, it works correctly (and has done for years - thank you very much).

The language / namespace files all exist and correctly loaded and parsed as JSON.

Is there something else that is needed to trigger when the dictionaries have been loaded?

Thank you.

The 'success' callback on init() should be called.

Body:
I seem to have a strange issue, where the 'ready' callback is not triggering when using resourcesToBackend in lazy load mode.

My code runs as follows and the language files are available on the path.
console.log also reports that the language / namespace dictionaries have loaded.

import i18next from 'i18next';
import i18nextBrowserLanguageDetector from 'i18next-browser-languagedetector';
import i18nextSprintfPostProcessor from 'i18next-sprintf-postprocessor';
import i18nextResourcesToBackend from 'i18next-resources-to-backend'

i18next.use(i18nextBrowserLanguageDetector).use(i18nextResourcesToBackend((language, namespace)=>{
      return new Promise(function(resolve, reject) {
         MyFsReadFile(`i18n/${language}/${namespace}.json`, (file)=>{
           const reader = new FileReader();
           reader.onload = (ev)=>{ resolve(JSON.parse(ev.target.result)) };
           reader.readAsText(file);
         }), (error)=>{
           if(process.env.NODE_ENV !== 'production') console.log('i18nextResourcesToBackend error', language, namespace, error);
           reject(error);
         }
      });
    })).use(i18nextSprintfPostProcessor)
  .init({
    fallbackLng: 'en',
    debug: process.env.NODE_ENV !== 'production',
    ns: ['app','test','core'], defaultNS: 'app', fallbackNS: 'core',
    overloadTranslationOptionHandler: i18nextSprintfPostProcessor.overloadTranslationOptionHandler
  }, (err, t)=> {

// this is never called ..!
  });

The strange thing is that the use of this configuration using the standard i18next-http-backend plugin, it works correctly (and has done for years - thank you very much).

The language / namespace files all exist and correctly loaded and parsed as JSON.

Is there something else that is needed to trigger when the dictionaries have been loaded?

Thank you.

The 'success' callback on init() should be called.


问:
Specific classes using CSS modules not working in React
I can't get CSS modules to work in Js - the plain global CSS module file is working, and so are non-specific classes like body are working, however I can't get classes.className to work for example.
I'd be glad of some help/ closure.
Thanks,

Edit: I don't have an error upon compiling
Edit 2: In Dev Tools no classes are shown unless I declare them statically like "className"

```<code>import React from "react";
import '.././Index.module.css';
import classes from "./CardLrg.module.css"

function CardLrg(props) {
    return (
        <div>
            <div className={classes.cardLrg}>
            <div className={classes.cardLrgHead}>
                <div className={classes.cardLrgDiscount}>{props.discount}</div>
                <img src="../../public/plus-square.svg" alt="Add to basket"/>
            </div>
            <div className={classes.cardLrgMainContent}>{props.sku}</div>
        </div>
        </div>

    )
}

export default CardLrg
</code>```
```<code>.cardLrg {
    height: 160px;
    width: 160px;
    border-radius: 10px;
    border: 5px solid #000000;
    box-shadow: 10px 10px 0px #000000;
    position: relative;
    background-color: #f7f7f7;
}
</code>```

Body:
I can't get CSS modules to work in Js - the plain global CSS module file is working, and so are non-specific classes like body are working, however I can't get classes.className to work for example.
I'd be glad of some help/ closure.
Thanks,

Edit: I don't have an error upon compiling
Edit 2: In Dev Tools no classes are shown unless I declare them statically like "className"

import React from "react";
import '.././Index.module.css';
import classes from "./CardLrg.module.css"

function CardLrg(props) {
    return (

{props.discount}

{props.sku}

    )
}

export default CardLrg

.cardLrg {
    height: 160px;
    width: 160px;
    border-radius: 10px;
    border: 5px solid #000000;
    box-shadow: 10px 10px 0px #000000;
    position: relative;
    background-color: #f7f7f7;
}


问:
Excel Application.ontime macro re-opens workbook
I have a workbook that is using some macros to automatically close it after some idle time elapses.
There is 1 issue, if the user has other excel workbooks (regardless if its xlsx or xlsm) after the procedure for it to close the target file. it REOPENS the target file again and can continue in a loop like this until the user closes all of their open workbooks quitting the application.

any advice on how to tweak this code so that the Application.OnTime events will stop effectively when the target workbook has closed would be appreciated.

The goal was simple:
If a user leaves their desk, or they are working on another workbook and they forget to close the file it will save and close the workbook and only that workbook without disrupting any other function or workbook

this does work fine on its own only if and only if the workbook that has this code is the only book open in the application.

In "Thisworkbook" I have below

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Call StopTimer
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    Call StopTimer
    Call SetTimer
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Call StopTimer
    Call SetTimer
End Sub
```
<p>In a separate module I have below:</p>
<pre class="lang-vb prettyprint-override"><code>Dim DownTime As Date

Sub SetTimer()
    DownTime = Now + TimeValue("00:15:00")
    Application.OnTime EarliestTime:=DownTime, _
        Procedure:="ShutDown", Schedule:=True
End Sub

Sub StopTimer()
    On Error Resume Next
    Application.OnTime EarliestTime:=DownTime, _
        Procedure:="ShutDown", Schedule:=False
End Sub

Sub ShutDown()
    Application.DisplayAlerts = False
    With Workbooks("Customer Complaint Tracker.xlsm")
        .Saved = True
        .Close
    End With
End Sub
</code>```

I have tried using a different method to run a timer which I think worked on windows timing instead of the application itself but I could not get it to function.

Body:
I have a workbook that is using some macros to automatically close it after some idle time elapses.
There is 1 issue, if the user has other excel workbooks (regardless if its xlsx or xlsm) after the procedure for it to close the target file. it REOPENS the target file again and can continue in a loop like this until the user closes all of their open workbooks quitting the application.

any advice on how to tweak this code so that the Application.OnTime events will stop effectively when the target workbook has closed would be appreciated.

The goal was simple:
If a user leaves their desk, or they are working on another workbook and they forget to close the file it will save and close the workbook and only that workbook without disrupting any other function or workbook

this does work fine on its own only if and only if the workbook that has this code is the only book open in the application.

In "Thisworkbook" I have below

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Call StopTimer
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    Call StopTimer
    Call SetTimer
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Call StopTimer
    Call SetTimer
End Sub

In a separate module I have below:

Dim DownTime As Date

Sub SetTimer()
    DownTime = Now + TimeValue("00:15:00")
    Application.OnTime EarliestTime:=DownTime, _
        Procedure:="ShutDown", Schedule:=True
End Sub

Sub StopTimer()
    On Error Resume Next
    Application.OnTime EarliestTime:=DownTime, _
        Procedure:="ShutDown", Schedule:=False
End Sub

Sub ShutDown()
    Application.DisplayAlerts = False
    With Workbooks("Customer Complaint Tracker.xlsm")
        .Saved = True
        .Close
    End With
End Sub

I have tried using a different method to run a timer which I think worked on windows timing instead of the application itself but I could not get it to function.


问:
Remove tuple with ory-keto
I am  working with a ory-keto server. I want to delete a tuple (using its api with postman)

I can list tuples and add them, but I cant delete them. It is a http-DELETE request to their endpoint /admin/relation-tuples.

the tuple I want to delete looks like

```<code>{
    namespace : "ns"
    object : "o1"
    relation :"r1"
    subject_set:
    {
        namespace : "ns",
        object :"o2"
        relation :"r2"
    }
}
</code>```

So Im making a DELETE-request to
https:///admin/relation-tuples?namespace=ns&object=o1&relation=r1&subject_set.namespace=ns&subject_set.object=02&subject_set.relation=r2

I get error "400 - Bad Request", but no other hints on what the problem is

With a http-GET-request (same endoint) and same parameters, I can get the selected Item. I get 1 hit.

I can create items, so my credentials are ok

For reference, this is a postman collection that uses the api

Title: Remove tuple with ory-keto

Body:
I am  working with a ory-keto server. I want to delete a tuple (using its api with postman)

I can list tuples and add them, but I cant delete them. It is a http-DELETE request to their endpoint /admin/relation-tuples.

the tuple I want to delete looks like

{
    namespace : "ns"
    object : "o1"
    relation :"r1"
    subject_set:
    {
        namespace : "ns",
        object :"o2"
        relation :"r2"
    }
}

So Im making a DELETE-request to
https:///admin/relation-tuples?namespace=ns&object=o1&relation=r1&subject_set.namespace=ns&subject_set.object=02&subject_set.relation=r2

I get error "400 - Bad Request", but no other hints on what the problem is

With a http-GET-request (same endoint) and same parameters, I can get the selected Item. I get 1 hit.

I can create items, so my credentials are ok

For reference, this is a postman collection that uses the api


问:
AJAX request in Laravel 8
I am trying to send AJAX request. My Route code is like below.

```<code>Route::group( ['prefix' => 'prayer', 'as' => 'prayer.'], function () {
   Route::get( 'time/{date}/{month}', 'PrayerTimeController@show' );
   Route::resource( 'time', 'PrayerTimeController' );
});
</code>```

My Controller code is like below

```<code>public function show($date,$month)
    {
        return $date;
    }

</code>```

My jQuery code is like below.

```<code>    $('#prayer_date').change(function(e){
        var month = $('#prayer_month').val();
        var date = $(this).val();
        $.ajax({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            url : "{{ route('vendor.prayer.time.show') }}"
            data: {month:month, date:date},
            type : 'POST',
            dataType : 'json',
            success : function(result){
               console.log(result);
            }
        });
    });
</code>```

But I am getting error local.ERROR: Missing required parameter for [Route: vendor.prayer.time.show] [URI: mosque-panel/prayer/time/{time}] [Missing parameter: time]..

How to send AJAX request in Laravel 8 ?

Title: AJAX request in Laravel 8

Body:
I am trying to send AJAX request. My Route code is like below.

Route::group( ['prefix' => 'prayer', 'as' => 'prayer.'], function () {
   Route::get( 'time/{date}/{month}', 'PrayerTimeController@show' );
   Route::resource( 'time', 'PrayerTimeController' );
});

My Controller code is like below

public function show($date,$month)
    {
        return $date;
    }

My jQuery code is like below.

    $('#prayer_date').change(function(e){
        var month = $('#prayer_month').val();
        var date = $(this).val();
        $.ajax({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            url : "{{ route('vendor.prayer.time.show') }}"
            data: {month:month, date:date},
            type : 'POST',
            dataType : 'json',
            success : function(result){
               console.log(result);
            }
        });
    });

But I am getting error local.ERROR: Missing required parameter for [Route: vendor.prayer.time.show] [URI: mosque-panel/prayer/time/{time}] [Missing parameter: time]..

How to send AJAX request in Laravel 8 ?


问:
Facing Issue with same variable name "node_config" for two different resource while creating a module
Module giving "Reference to undeclared resource" when I am creating a Google Container cluster and I am using two resources with same dynamic input value "node_config"

This is my main.tf file

```<code>resource "google_container_cluster" "primary" {
  name        = var.name
  location    = var.location
  description = var.description
  project     = var.project
  # We can't create a cluster with no node pool defined, but we want to only use
  # separately managed node pools. So we create the smallest possible default
  # node pool and immediately delete it.
  #  default_max_pods_per_node   = var.default_max_pods_per_node
  enable_tpu                  = var.enable_tpu
  enable_shielded_nodes       = var.enable_shielded_nodes
  enable_legacy_abac          = var.enable_legacy_abac
  enable_kubernetes_alpha     = var.enable_kubernetes_alpha
  enable_intranode_visibility = var.enable_intranode_visibility
  node_locations              = var.node_locations
  resource_labels             = var.resource_labels
  remove_default_node_pool    = var.remove_default_node_pool
  initial_node_count          = var.initial_node_count

  dynamic "node_config" {
    for_each = var.node_config
    content {
      disk_size_gb     = node_config.value["disk_size_gb"]
      disk_type        = node_config.value["disk_type"]
      image_type       = node_config.value["image_type"]
      labels           = node_config.value["labels"]
      local_ssd_count  = node_config.value["local_ssd_count"]
      machine_type     = node_config.value["machine_type"]
      metadata         = node_config.value["metadata"]
      min_cpu_platform = node_config.value["min_cpu_platform"]
      oauth_scopes     = node_config.value["oauth_scopes"]
      preemptible      = node_config.value["preemptible"]
      dynamic "shielded_instance_config" {
        for_each = node_config.value.shielded_instance_config
        content {
          enable_integrity_monitoring = shielded_instance_config.value["enable_integrity_monitoring"]
          enable_secure_boot          = shielded_instance_config.value["enable_secure_boot"]
        }
      }
      tags = node_config.value["tags"]

    }
  }
}

resource "google_container_node_pool" "primary_preemptible_nodes" {
  name           = var.nodepool_name
  location       = var.location
  project        = var.project
  cluster        = google_container_cluster.primary.name
  node_count     = var.nodepool_node_count
  node_locations = var.node_locations

  dynamic "node_config" {
    for_each = var.ndpool_node_config
    content {
      disk_size_gb = ndpool_node_config.value["disk_size_gb"]
      disk_type    = ndpool_node_config.value["disk_type"]
      preemptible  = ndpool_node_config.value["preemptible"]
      image_type   = ndpool_node_config.value["image_type"]
      machine_type = ndpool_node_config.value["machine_type"]
      oauth_scopes = ndpool_node_config.value["oauth_scopes"]
    }
  }
}

</code>```

This my module definition inside module folder

```<code>module "google_container_cluster" {
  source      = "../"
  name        = var.name
  location    = var.location
  description = var.description
  project     = var.project
  # We can't create a cluster with no node pool defined, but we want to only use
  # separately managed node pools. So we create the smallest possible default
  # node pool and immediately delete it.
  #  default_max_pods_per_node   = var.default_max_pods_per_node
  enable_tpu                  = var.enable_tpu
  enable_shielded_nodes       = var.enable_shielded_nodes
  enable_legacy_abac          = var.enable_legacy_abac
  enable_kubernetes_alpha     = var.enable_kubernetes_alpha
  enable_intranode_visibility = var.enable_intranode_visibility
  node_locations              = var.node_locations
  resource_labels             = var.resource_labels
  remove_default_node_pool    = var.remove_default_node_pool
  initial_node_count          = var.initial_node_count
  node_config                 = var.node_config
  nodepool_name               = var.nodepool_name
  nodepool_node_count         = var.nodepool_node_count
}

</code>```

My terraform.tfvars are as follows

```<code>name        = "tf-gcp-cluster"
location    = "us-central1-c"
description = "Cluster Creation using TF"
project     = "gcp-terraform-prjt"
#default_max_pods_per_node   = ""
enable_tpu                  = false
enable_shielded_nodes       = false
enable_legacy_abac          = false
enable_kubernetes_alpha     = false
enable_intranode_visibility = false
node_locations              = []
resource_labels = {
  "test" = "tftestgcp"
}
remove_default_node_pool = true
initial_node_count       = 1

node_config = [{
  disk_size_gb = "10"
  disk_type    = "pd-standard"
  image_type   = "cos_containerd"
  labels = {
    "test" = "tf-container-cluster"
  }
  local_ssd_count = "0"
  machine_type    = "e2-micro"
  metadata = {
    "key" = "value"
  }
  min_cpu_platform = ""
  oauth_scopes = [
    "https://www.googleapis.com/auth/cloud-platform"
  ]
  preemptible = true
  shielded_instance_config = [{
    enable_integrity_monitoring = false
    enable_secure_boot          = false
  }]

  tags = ["value"]

}]
nodepool_name = "tf-nodepool"

nodepool_node_count = 1

ndpool_node_config = [{
  disk_size_gb = 10
  disk_type    = "pd-standard"
  image_type   = "cos_container"
  machine_type = "e2-micro"
  oauth_scopes = [
    "https://www.googleapis.com/auth/cloud-platform"
  ]
  preemptible = false
}]
</code>```

I have supplied value for both "node_config" and "ndpool_node_config" but for some reason it is giving me following error when i run terraform plan command
╷

```<code>│ Error: Reference to undeclared resource
│
│   on ../main.tf line 57, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   57:       disk_size_gb = ndpool_node_config.value["disk_size_gb"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 58, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   58:       disk_type    = ndpool_node_config.value["disk_type"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 59, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   59:       preemptible  = ndpool_node_config.value["preemptible"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 60, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   60:       image_type   = ndpool_node_config.value["image_type"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 61, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   61:       machine_type = ndpool_node_config.value["machine_type"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 62, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   62:       oauth_scopes = ndpool_node_config.value["oauth_scopes"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
</code>```

I want the value to be passed down as i have defined them, if i remove it created the node_pool with default values rather than the values defined by me.

Body:
Module giving "Reference to undeclared resource" when I am creating a Google Container cluster and I am using two resources with same dynamic input value "node_config"

This is my main.tf file

resource "google_container_cluster" "primary" {
  name        = var.name
  location    = var.location
  description = var.description
  project     = var.project
  # We can't create a cluster with no node pool defined, but we want to only use
  # separately managed node pools. So we create the smallest possible default
  # node pool and immediately delete it.
  #  default_max_pods_per_node   = var.default_max_pods_per_node
  enable_tpu                  = var.enable_tpu
  enable_shielded_nodes       = var.enable_shielded_nodes
  enable_legacy_abac          = var.enable_legacy_abac
  enable_kubernetes_alpha     = var.enable_kubernetes_alpha
  enable_intranode_visibility = var.enable_intranode_visibility
  node_locations              = var.node_locations
  resource_labels             = var.resource_labels
  remove_default_node_pool    = var.remove_default_node_pool
  initial_node_count          = var.initial_node_count

  dynamic "node_config" {
    for_each = var.node_config
    content {
      disk_size_gb     = node_config.value["disk_size_gb"]
      disk_type        = node_config.value["disk_type"]
      image_type       = node_config.value["image_type"]
      labels           = node_config.value["labels"]
      local_ssd_count  = node_config.value["local_ssd_count"]
      machine_type     = node_config.value["machine_type"]
      metadata         = node_config.value["metadata"]
      min_cpu_platform = node_config.value["min_cpu_platform"]
      oauth_scopes     = node_config.value["oauth_scopes"]
      preemptible      = node_config.value["preemptible"]
      dynamic "shielded_instance_config" {
        for_each = node_config.value.shielded_instance_config
        content {
          enable_integrity_monitoring = shielded_instance_config.value["enable_integrity_monitoring"]
          enable_secure_boot          = shielded_instance_config.value["enable_secure_boot"]
        }
      }
      tags = node_config.value["tags"]

    }
  }
}

resource "google_container_node_pool" "primary_preemptible_nodes" {
  name           = var.nodepool_name
  location       = var.location
  project        = var.project
  cluster        = google_container_cluster.primary.name
  node_count     = var.nodepool_node_count
  node_locations = var.node_locations

  dynamic "node_config" {
    for_each = var.ndpool_node_config
    content {
      disk_size_gb = ndpool_node_config.value["disk_size_gb"]
      disk_type    = ndpool_node_config.value["disk_type"]
      preemptible  = ndpool_node_config.value["preemptible"]
      image_type   = ndpool_node_config.value["image_type"]
      machine_type = ndpool_node_config.value["machine_type"]
      oauth_scopes = ndpool_node_config.value["oauth_scopes"]
    }
  }
}

This my module definition inside module folder

module "google_container_cluster" {
  source      = "../"
  name        = var.name
  location    = var.location
  description = var.description
  project     = var.project
  # We can't create a cluster with no node pool defined, but we want to only use
  # separately managed node pools. So we create the smallest possible default
  # node pool and immediately delete it.
  #  default_max_pods_per_node   = var.default_max_pods_per_node
  enable_tpu                  = var.enable_tpu
  enable_shielded_nodes       = var.enable_shielded_nodes
  enable_legacy_abac          = var.enable_legacy_abac
  enable_kubernetes_alpha     = var.enable_kubernetes_alpha
  enable_intranode_visibility = var.enable_intranode_visibility
  node_locations              = var.node_locations
  resource_labels             = var.resource_labels
  remove_default_node_pool    = var.remove_default_node_pool
  initial_node_count          = var.initial_node_count
  node_config                 = var.node_config
  nodepool_name               = var.nodepool_name
  nodepool_node_count         = var.nodepool_node_count
}

My terraform.tfvars are as follows

name        = "tf-gcp-cluster"
location    = "us-central1-c"
description = "Cluster Creation using TF"
project     = "gcp-terraform-prjt"
#default_max_pods_per_node   = ""
enable_tpu                  = false
enable_shielded_nodes       = false
enable_legacy_abac          = false
enable_kubernetes_alpha     = false
enable_intranode_visibility = false
node_locations              = []
resource_labels = {
  "test" = "tftestgcp"
}
remove_default_node_pool = true
initial_node_count       = 1

node_config = [{
  disk_size_gb = "10"
  disk_type    = "pd-standard"
  image_type   = "cos_containerd"
  labels = {
    "test" = "tf-container-cluster"
  }
  local_ssd_count = "0"
  machine_type    = "e2-micro"
  metadata = {
    "key" = "value"
  }
  min_cpu_platform = ""
  oauth_scopes = [
    "https://www.googleapis.com/auth/cloud-platform"
  ]
  preemptible = true
  shielded_instance_config = [{
    enable_integrity_monitoring = false
    enable_secure_boot          = false
  }]

  tags = ["value"]

}]
nodepool_name = "tf-nodepool"

nodepool_node_count = 1

ndpool_node_config = [{
  disk_size_gb = 10
  disk_type    = "pd-standard"
  image_type   = "cos_container"
  machine_type = "e2-micro"
  oauth_scopes = [
    "https://www.googleapis.com/auth/cloud-platform"
  ]
  preemptible = false
}]

I have supplied value for both "node_config" and "ndpool_node_config" but for some reason it is giving me following error when i run terraform plan command
╷

│ Error: Reference to undeclared resource
│
│   on ../main.tf line 57, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   57:       disk_size_gb = ndpool_node_config.value["disk_size_gb"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 58, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   58:       disk_type    = ndpool_node_config.value["disk_type"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 59, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   59:       preemptible  = ndpool_node_config.value["preemptible"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 60, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   60:       image_type   = ndpool_node_config.value["image_type"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 61, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   61:       machine_type = ndpool_node_config.value["machine_type"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.
╵
╷
│ Error: Reference to undeclared resource
│
│   on ../main.tf line 62, in resource "google_container_node_pool" "primary_preemptible_nodes":
│   62:       oauth_scopes = ndpool_node_config.value["oauth_scopes"]
│
│ A managed resource "ndpool_node_config" "value" has not been declared in module.google_container_cluster.

I want the value to be passed down as i have defined them, if i remove it created the node_pool with default values rather than the values defined by me.


问:
Running TestWebAppCoreAngularApi httpClient.GetAsync(idPMetadataUrl timesout
When running the sample application TestWebAppCoreAngularApi, the request httpClient.GetAsync(https://localhost:44309/metadata) is timing out, anybody have any suggestions

The original setting was https://localhost:44305/metadata, however this is incorrect as it failed with No connection could be made because the target machine actively refused it, I then changed it to
https://localhost:44309/metadata which is timing out


问:
I can't connect to Microsoft SQL Server through Java
I have SQL Server installed through Docker on Windows and I can connect to the database with VS Code through the SQL Server extension, but I can't get it to connect in my Java code. I get the error:

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not
establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target".
ClientConnectionId:018acf50-eefc-41e8-842a-6b7ef89a84d9

I installed the JDBC driver through Maven:

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>11.2.2.jre17</version>
</dependency>
```
<p>The code:</p>
<pre class="lang-java prettyprint-override"><code>import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectToMSSQL {

    public static void main(String[] args) {

        // Set connection parameters.
        String hostName = "localhost";
        String dbName = "testdb";
        String user = "SA";
        String password = "<password>";
        String url = String.format("jdbc:sqlserver://%s;databaseName=%s;user=%s;password=%s", hostName, dbName, user, password);

        // Connect to the database.
        try (Connection con = DriverManager.getConnection(url)) {
            System.out.println("Connection established.");
        } catch (SQLException e) {
            System.out.println("Connection failed.");
            e.printStackTrace();
        }
    }
}
</code>```

Body:
I have SQL Server installed through Docker on Windows and I can connect to the database with VS Code through the SQL Server extension, but I can't get it to connect in my Java code. I get the error:

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not
establish a secure connection to SQL Server by using Secure Sockets
Layer (SSL) encryption. Error: "PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target".
ClientConnectionId:018acf50-eefc-41e8-842a-6b7ef89a84d9

I installed the JDBC driver through Maven:

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>11.2.2.jre17</version>
</dependency>

The code:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectToMSSQL {

    public static void main(String[] args) {

        // Set connection parameters.
        String hostName = "localhost";
        String dbName = "testdb";
        String user = "SA";
        String password = "<password>";
        String url = String.format("jdbc:sqlserver://%s;databaseName=%s;user=%s;password=%s", hostName, dbName, user, password);

        // Connect to the database.
        try (Connection con = DriverManager.getConnection(url)) {
            System.out.println("Connection established.");
        } catch (SQLException e) {
            System.out.println("Connection failed.");
            e.printStackTrace();
        }
    }
}


问:
Getting error for choosing radio button(Element is not clickable at point (286,871) because another element )
Getting error while choosing Radio button.

```<code>Element <input class="bb-input-radio-group__input" name="ngb-radio-0" type="radio"> is not clickable at point (286,871) because another element <label class="bb-input-radio-group__radio bb-input-radio-group__radio--vertical-align-middle btn"> obscures it
</code>```
```<code>public void chooseExpirationFromTheList(String expiration){
    base.two();
    base.waitForLocateBySelector(By.cssSelector("label[data-role*='radio-group-option']"));
    List<WebElement> chooseExpiration = base.driver.findElements(By.cssSelector("label[data-role*='radio-group-option']"));
    WebElement expirationFromList = base.pullObjectFromList(chooseExpiration, expiration);
    expirationFromList.findElement(By.cssSelector("input[type*='radio']")).click();
}
</code>```

anyone could you please help

Body:
Getting error while choosing Radio button.

Element <input class="bb-input-radio-group__input" name="ngb-radio-0" type="radio"> is not clickable at point (286,871) because another element  obscures it

public void chooseExpirationFromTheList(String expiration){
    base.two();
    base.waitForLocateBySelector(By.cssSelector("label[data-role*='radio-group-option']"));
    List<WebElement> chooseExpiration = base.driver.findElements(By.cssSelector("label[data-role*='radio-group-option']"));
    WebElement expirationFromList = base.pullObjectFromList(chooseExpiration, expiration);
    expirationFromList.findElement(By.cssSelector("input[type*='radio']")).click();
}

anyone could you please help


问:
How to calculate frequency per groups in Tableau
I want to create a barplot showing the frequencies that each age appears on the table. (Each Id represents a person)

I was expecting to get the frequency by adding count but it doesn't work


问:
How to turn on all axes boundaries of a 3D scatterplot?
How can I turn on all axes lines of a 3D scatterplot? More specifically, how can I make a scatterplot like this:

Stay like this:


问:
Chrome devtools thinks destructuring assignment creates a block scope
The Chrome devtools has a Scope panel indicating the scope of the variables in the current scope. This can be used when stepping through code. It has subsections for local, global, module and also block scope. So if a variable is locally scoped it will show up under the local scope subsection.

But with the following bit of code the devtools tell me _c is block scoped and _d is locally scoped. The only difference between the two bits of code is that I destructure in the function header.

[[1, 2]].forEach(([_a, _b]) => {
  const _c = 1; // Block scoped
  debugger;
});

[[1, 2]].forEach(_number => {
  const _d = 1; // Local scoped
  debugger;
});
```
<p><img src="https://i.stack.imgur.com/g15K2.png" alt="The Scope panel in the Source panel" /></p>
<p>I can't think of a reason why <code>_c</code> would be block scoped. Am I missing something? Could this be a Chrome bug? I'm running version <code>108.0.5359.124 </code></p>
<p>To easily reproduce here's a full HTML doc you can copy paste.</p>
<pre class="lang-html prettyprint-override"><code><!DOCTYPE html>
<html lang="en">

<head>
  <script>
    [[1, 2]].forEach(([_a, _b]) => {
      const _c = 1; // Block scoped
      debugger;
    });

    [[1, 2]].forEach(_number => {
      const _d = 1; // Local scoped
      debugger;
    });
  </script>
  <title>Document</title>
</head>

<body>
  See the console

</body>

</html>

</code>```

I don't think the fact that const and let are block-scoped has anything to do with it. If you run this code you'll see that _e and _f are correctly marked as scoped to the block by the devtools.

(() => { // An IIFE so we get local function scope
  if (true) {
    // In a block
    const _e = 1;
    let _f = 2;
    var _g = 3;
    debugger; // _e and _f are block scoped so available here
    // _g is locally scoped so also available here
  }
  debugger;
  // _e and _f are block scoped so NOT available here
  // _g is locally scoped so also available here
})();
```

Body:
The Chrome devtools has a Scope panel indicating the scope of the variables in the current scope. This can be used when stepping through code. It has subsections for local, global, module and also block scope. So if a variable is locally scoped it will show up under the local scope subsection.

But with the following bit of code the devtools tell me _c is block scoped and _d is locally scoped. The only difference between the two bits of code is that I destructure in the function header.

[[1, 2]].forEach(([_a, _b]) => {
  const _c = 1; // Block scoped
  debugger;
});

[[1, 2]].forEach(_number => {
  const _d = 1; // Local scoped
  debugger;
});

I can't think of a reason why _c would be block scoped. Am I missing something? Could this be a Chrome bug? I'm running version 108.0.5359.124

To easily reproduce here's a full HTML doc you can copy paste.

<!DOCTYPE html>

  <title>Document</title>

  See the console

I don't think the fact that const and let are block-scoped has anything to do with it. If you run this code you'll see that _e and _f are correctly marked as scoped to the block by the devtools.

(() => { // An IIFE so we get local function scope
  if (true) {
    // In a block
    const _e = 1;
    let _f = 2;
    var _g = 3;
    debugger; // _e and _f are block scoped so available here
    // _g is locally scoped so also available here
  }
  debugger;
  // _e and _f are block scoped so NOT available here
  // _g is locally scoped so also available here
})();


问:
Can i able to update html files to springboot application in cpanel
i want to update html files to springboot application in cpanel

First we upload the html page and then can we able to update the html files to spring boot project in cpanel?


问:
Create tuple from two columns values
I need to extract a tuple from two column values

```<code>def selectiem():
    item = table.selection()
    a, b= [], []
    for i in item:
        a.append(table.item(i)['values'][22])
        b.append(table.item(i)['values'][23])
    print(a, b)

result of print: ['44.38', '44.4', '44.13'] ['40.38', '30.4', '29.13']
</code>```

I tried to extract like this:

```<code>print(a[1], b[1], a[2], b[2]) # but how to do this for all the selected items?
</code>```

My expectation are for a tuples of this form:

```<code>expectation = [44.38, 40.38], [44.4, 30.4], [44.13, 29.13]
</code>```

Title: Create tuple from two columns values

Body:
I need to extract a tuple from two column values

def selectiem():
    item = table.selection()
    a, b= [], []
    for i in item:
        a.append(table.item(i)['values'][22])
        b.append(table.item(i)['values'][23])
    print(a, b)

result of print: ['44.38', '44.4', '44.13'] ['40.38', '30.4', '29.13']

I tried to extract like this:

print(a[1], b[1], a[2], b[2]) # but how to do this for all the selected items?

My expectation are for a tuples of this form:

expectation = [44.38, 40.38], [44.4, 30.4], [44.13, 29.13]


问:
PowerShell Trim is trimming more than it should
I'm trying to figure out why the following PowerShell code ends up with $manifestObj.name being Microsoft Power Automa instead of Microsoft Power Automate.  The full code actually gets all the extension folders for the Chrome profile via a foreach loop, but this example produces the same issue.

```<code>$manifestObj = New-Object System.Object

$manifestJSON = Get-Content "C:\Users\<MyUserName>\AppData\Local\Google\Chrome\User Data\Default\Extensions\ljglajjnnkapghbckkcmodicjhacbfhk\2.27.0.2_0\manifest.json" -Raw | ConvertFrom-Json

$manifestObj = New-Object System.Object
#get name and version from json and add to object
$manifestObj | Add-Member -MemberType NoteProperty -Name Name -Value $manifestJSON.name
$manifestObj | Add-Member -MemberType NoteProperty -Name Version -Value $manifestJSON.version

$url = "https://chrome.google.com/webstore/detail/ljglajjnnkapghbckkcmodicjhacbfhk"
$stringToTrim = " - Chrome Web Store"

$webClient = New-Object System.Net.WebClient

$data = $webClient.downloadstring($url)
#scrape the title
$titleTag = [regex] '(?<=<title>)([\S\s]*?)(?=</title>)'
#trim the title
$title = $titleTag.Match($data).value.trim()
$manifestObj.name = $title.Trim($stringToTrim)

</code>```

Body:
I'm trying to figure out why the following PowerShell code ends up with $manifestObj.name being Microsoft Power Automa instead of Microsoft Power Automate.  The full code actually gets all the extension folders for the Chrome profile via a foreach loop, but this example produces the same issue.

$manifestObj = New-Object System.Object

$manifestJSON = Get-Content "C:\Users\<MyUserName>\AppData\Local\Google\Chrome\User Data\Default\Extensions\ljglajjnnkapghbckkcmodicjhacbfhk\2.27.0.2_0\manifest.json" -Raw | ConvertFrom-Json

$manifestObj = New-Object System.Object
#get name and version from json and add to object
$manifestObj | Add-Member -MemberType NoteProperty -Name Name -Value $manifestJSON.name
$manifestObj | Add-Member -MemberType NoteProperty -Name Version -Value $manifestJSON.version

$url = "https://chrome.google.com/webstore/detail/ljglajjnnkapghbckkcmodicjhacbfhk"
$stringToTrim = " - Chrome Web Store"

$webClient = New-Object System.Net.WebClient

$data = $webClient.downloadstring($url)
#scrape the title
$titleTag = [regex] '(?<=<title>)([\S\s]*?)(?=</title>)'
#trim the title
$title = $titleTag.Match($data).value.trim()
$manifestObj.name = $title.Trim($stringToTrim)


问:
Kafka CooperativeStickyAssignor revokes/assigns partition in one rebalance cycle
I have an application that runs 6 consumers in parallel. I am getting some unexpected results when I use CooperativeStickyAssignor.
If I understand the mechanism correctly, if the consumer looses partition in one rebalance cycle, the partition will be assigned in the next rebalance cycle.

This assumption is based on the RebalanceProtocol documentation and few blog posts that describe the protocol, like this one on Confluent blog.

The assignor should not reassign any owned partitions immediately, but
instead may indicate consumers the need for partition revocation so
that the revoked partitions can be reassigned to other consumers in
the next rebalance event. This is designed for sticky assignment logic
which attempts to minimize partition reassignment with cooperative
adjustments.

Any member that revoked partitions then rejoins the group, triggering
a second rebalance so that its revoked partitions can be assigned.
Until then, these partitions are unowned and unassigned.

These are the logs from the application that uses protocol='cooperative-sticky'. In the same rebalance cycle (generationId=640) partition 74 moves from consumer-3 to consumer-4. I omitted the lines that are logged by the other 4 consumers.

Mind that the log is in reverse(bottom to top)

2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : New partition assignment: partition-59, seek to min common offset: 85120524
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler2   : Partitions [partition-59] assigned successfully
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : Partitions assigned: [partition-59]
2022-12-14 11:18:24   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Adding newly assigned partitions: partition-59
2022-12-14 11:18:24   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Notifying assignor about the new Assignment(partitions=[partition-59])
2022-12-14 11:18:24   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Request joining group due to: need to revoke partitions [partition-26, partition-74] as indicated by the current assignment and re-join
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler2   : Partitions [partition-26, partition-74] revoked successfully
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : Finished removing partition data
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] (Re-)joining group
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : New partition assignment: partition-74, seek to min common offset: 107317730
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler2   : Partitions [partition-74] assigned successfully
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : Partitions assigned: [partition-74]
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Adding newly assigned partitions: partition-74
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Notifying assignor about the new Assignment(partitions=[partition-74])
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Request joining group due to: need to revoke partitions [partition-57] as indicated by the current assignment and re-join
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler2   : Partitions [partition-57] revoked successfully
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : Finished removing partition data
2022-12-14 11:18:22   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : Partitions revoked: [partition-26, partition-74]
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Revoke previously assigned partitions partition-26, partition-74
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Updating assignment with\n\tAssigned partitions:                       [partition-59]\n\tCurrent owned partitions:                  [partition-26, partition-74]\n\tAdded partitions (assigned - owned):       [partition-59]\n\tRevoked partitions (owned - assigned):     [partition-26, partition-74]
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Successfully synced group in generation Generation{generationId=640, memberId='partition-3-my-client-id-my-group-id-c31afd19-3f22-43cb-ad07-9088aa98d3af', protocol='cooperative-sticky'}
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Successfully joined group with generation Generation{generationId=640, memberId='partition-3-my-client-id-my-group-id-c31afd19-3f22-43cb-ad07-9088aa98d3af', protocol='cooperative-sticky'}
2022-12-14 11:18:22   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : Partitions revoked: [partition-57]
2022-12-14 11:18:22   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Revoke previously assigned partitions partition-57
2022-12-14 11:18:22   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Updating assignment with\n\tAssigned partitions:                       [partition-74]\n\tCurrent owned partitions:                  [partition-57]\n\tAdded partitions (assigned - owned):       [partition-74]\n\tRevoked partitions (owned - assigned):     [partition-57]
2022-12-14 11:18:21   1 --- [id-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Successfully synced group in generation Generation{generationId=640, memberId='partition-4-my-client-id-my-group-id-ae2af665-edc9-4a8e-b658-98372d142477', protocol='cooperative-sticky'}
2022-12-14 11:18:21   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Successfully joined group with generation Generation{generationId=640, memberId='partition-4-my-client-id-my-group-id-ae2af665-edc9-4a8e-b658-98372d142477', protocol='cooperative-sticky'}
```

What am I missing here?

I expect that the partition gets revoked in one rebalance cycle and gets assigned in the next.

Kafka client version is 3.2.1.

Body:
I have an application that runs 6 consumers in parallel. I am getting some unexpected results when I use CooperativeStickyAssignor.
If I understand the mechanism correctly, if the consumer looses partition in one rebalance cycle, the partition will be assigned in the next rebalance cycle.

This assumption is based on the RebalanceProtocol documentation and few blog posts that describe the protocol, like this one on Confluent blog.

The assignor should not reassign any owned partitions immediately, but
instead may indicate consumers the need for partition revocation so
that the revoked partitions can be reassigned to other consumers in
the next rebalance event. This is designed for sticky assignment logic
which attempts to minimize partition reassignment with cooperative
adjustments.

Any member that revoked partitions then rejoins the group, triggering
a second rebalance so that its revoked partitions can be assigned.
Until then, these partitions are unowned and unassigned.

These are the logs from the application that uses protocol='cooperative-sticky'. In the same rebalance cycle (generationId=640) partition 74 moves from consumer-3 to consumer-4. I omitted the lines that are logged by the other 4 consumers.

Mind that the log is in reverse(bottom to top)

2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : New partition assignment: partition-59, seek to min common offset: 85120524
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler2   : Partitions [partition-59] assigned successfully
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : Partitions assigned: [partition-59]
2022-12-14 11:18:24   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Adding newly assigned partitions: partition-59
2022-12-14 11:18:24   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Notifying assignor about the new Assignment(partitions=[partition-59])
2022-12-14 11:18:24   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Request joining group due to: need to revoke partitions [partition-26, partition-74] as indicated by the current assignment and re-join
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler2   : Partitions [partition-26, partition-74] revoked successfully
2022-12-14 11:18:24   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : Finished removing partition data
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] (Re-)joining group
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : New partition assignment: partition-74, seek to min common offset: 107317730
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler2   : Partitions [partition-74] assigned successfully
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : Partitions assigned: [partition-74]
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Adding newly assigned partitions: partition-74
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Notifying assignor about the new Assignment(partitions=[partition-74])
2022-12-14 11:18:24   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Request joining group due to: need to revoke partitions [partition-57] as indicated by the current assignment and re-join
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler2   : Partitions [partition-57] revoked successfully
2022-12-14 11:18:24   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : Finished removing partition data
2022-12-14 11:18:22   1 --- [consumer-3] x.y.z.MyRebalanceHandler1   : Partitions revoked: [partition-26, partition-74]
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Revoke previously assigned partitions partition-26, partition-74
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Updating assignment with\n\tAssigned partitions:                       [partition-59]\n\tCurrent owned partitions:                  [partition-26, partition-74]\n\tAdded partitions (assigned - owned):       [partition-59]\n\tRevoked partitions (owned - assigned):     [partition-26, partition-74]
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Successfully synced group in generation Generation{generationId=640, memberId='partition-3-my-client-id-my-group-id-c31afd19-3f22-43cb-ad07-9088aa98d3af', protocol='cooperative-sticky'}
2022-12-14 11:18:22   1 --- [consumer-3] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-3-my-client-id-my-group-id, groupId=my-group-id] Successfully joined group with generation Generation{generationId=640, memberId='partition-3-my-client-id-my-group-id-c31afd19-3f22-43cb-ad07-9088aa98d3af', protocol='cooperative-sticky'}
2022-12-14 11:18:22   1 --- [consumer-4] x.y.z.MyRebalanceHandler1   : Partitions revoked: [partition-57]
2022-12-14 11:18:22   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Revoke previously assigned partitions partition-57
2022-12-14 11:18:22   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Updating assignment with\n\tAssigned partitions:                       [partition-74]\n\tCurrent owned partitions:                  [partition-57]\n\tAdded partitions (assigned - owned):       [partition-74]\n\tRevoked partitions (owned - assigned):     [partition-57]
2022-12-14 11:18:21   1 --- [id-1] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Successfully synced group in generation Generation{generationId=640, memberId='partition-4-my-client-id-my-group-id-ae2af665-edc9-4a8e-b658-98372d142477', protocol='cooperative-sticky'}
2022-12-14 11:18:21   1 --- [consumer-4] o.a.k.c.c.internals.ConsumerCoordinator  : [Consumer clientId=partition-4-my-client-id-my-group-id, groupId=my-group-id] Successfully joined group with generation Generation{generationId=640, memberId='partition-4-my-client-id-my-group-id-ae2af665-edc9-4a8e-b658-98372d142477', protocol='cooperative-sticky'}

What am I missing here?

I expect that the partition gets revoked in one rebalance cycle and gets assigned in the next.

Kafka client version is 3.2.1.


问:
How to make hovering text for a custom coordinates in Rust using egui?
I'm trying to make visualization for iterative algorithm, using macroquad and egui. Pure plot on macroquad looks like this:

Note that each circle or vertice is a struct instance with N fields, content from which I want to appear with hovering over the circle's perimeter?

How can I do it? Which way is more elegant/better to use? I think of writing custom widget for each circle and therefore hovering on this widget. But it seems complicated — I have a lot of circles thus need a lot of widgets. Probably better would be using some fields, where if user clicked, window appeared with information.

Any help is really appreciated


问:
Auth0 custom database asynchronous callback
I'm pretty new to Node.JS asynchronous behavior and I'm using it within the Auth0 solution to authenticate user. Basically you can create a Custom Database where you can write your own login code, but the issue is more Javascript related than Auth0 anyway.

Here is my code (I'm omitting some functions because they are unrelevant to my issue) :

```<code>function login(email, password, callback) {
    const request = require('request');
    const url = "<URL>";
    const audience = "<URL>";
    const DB1 = "db1";
    const DB2 = "db2";

    callAuth0DB(email, callback).then(jsonUser =>  {
        console.log("jsonUser", jsonUser);
        callback(null, jsonUser)
    });

    console.log("Async too late");

    function callAuth0DB(email, callback) {
        return new Promise((resolve) => {
            let jsonUser = {};

            //DB 1
            const optionsDB1 = configureDBRequest(email, password, DB1);

            request(optionsDB1, function(error, response) {
                if (error) {
                    console.log(error);
                    throw new Error(error);
                }
                let body = JSON.parse(response.body);

                try {
                    let token = JSON.parse(
                        Buffer.from(body.access_token.split(".")[1], "base64").toString()
                    );
                    callback(null, {
                        user_id: token.sub,
                        email: email,
                    });
                } catch (e) {
                    //DB 3
                    console.log("Trying DB 2");

                    const username = email.substring(0, email.indexOf("@"));
                    const commonUsername = username.substring(0, username.indexOf("+"));

                    getApiToken().then(apiToken => getUsers(apiToken, commonUsername).then(async users => {
                        for (let u of users) {
                            const optionsDB2 = configureDBRequest(u.email, password, DB2);

                            authUser(optionsDB2, u.email)
                            .then(sub => {
                                //Case 1
                                if (sub) {
                                    jsonUser = {
                                        user_id: sub,
                                        email: u,
                                    };
                                }
                            })
                            .catch(e => {
                                if (JSON.parse(e).error !== "invalid_grant") {
                                    //Case 2
                                    console.log("u", u);
                                    jsonUser = u;
                                }
                            });

                        }

                    }));
                }
            });
            resolve(jsonUser);
        });
    }
}
</code>```

My issue is that everything works fine.

My jsonUser contains exactly what I need but as it is asynchronous, the callback function (which is why I have to return) execute after my log console.log("Async too late");. This causes Auth0 to never take my callback response and fails.

Is there a way to actually wait for my callback to execute before continuing ?

EDIT

I can had a log to show what's happening :

```<code>3:17:07 PM:     new webtask request
3:17:07 PM:     jsonUser {}
3:17:07 PM:     finished webtask request
3:17:07 PM:     Trying DB 2
3:17:07 PM:     new webtask request
3:17:07 PM:     Redirecting is not possible in a 'oauth2-password' flow or when prompt=none. Skipping redirect.
3:17:07 PM:     finished webtask request
3:17:07 PM:     u {
user_id: '<user_id>',
email: '<email>'
}
</code>```

EDIT 2

This is different from How do I return the response from an asynchronous call? as I do not have hands on what's calling the login function and cannot define things outside it.

Body:
I'm pretty new to Node.JS asynchronous behavior and I'm using it within the Auth0 solution to authenticate user. Basically you can create a Custom Database where you can write your own login code, but the issue is more Javascript related than Auth0 anyway.

Here is my code (I'm omitting some functions because they are unrelevant to my issue) :

function login(email, password, callback) {
    const request = require('request');
    const url = "<URL>";
    const audience = "<URL>";
    const DB1 = "db1";
    const DB2 = "db2";

    callAuth0DB(email, callback).then(jsonUser =>  {
        console.log("jsonUser", jsonUser);
        callback(null, jsonUser)
    });

    console.log("Async too late");

    function callAuth0DB(email, callback) {
        return new Promise((resolve) => {
            let jsonUser = {};

            //DB 1
            const optionsDB1 = configureDBRequest(email, password, DB1);

            request(optionsDB1, function(error, response) {
                if (error) {
                    console.log(error);
                    throw new Error(error);
                }
                let body = JSON.parse(response.body);

                try {
                    let token = JSON.parse(
                        Buffer.from(body.access_token.split(".")[1], "base64").toString()
                    );
                    callback(null, {
                        user_id: token.sub,
                        email: email,
                    });
                } catch (e) {
                    //DB 3
                    console.log("Trying DB 2");

                    const username = email.substring(0, email.indexOf("@"));
                    const commonUsername = username.substring(0, username.indexOf("+"));

                    getApiToken().then(apiToken => getUsers(apiToken, commonUsername).then(async users => {
                        for (let u of users) {
                            const optionsDB2 = configureDBRequest(u.email, password, DB2);

                            authUser(optionsDB2, u.email)
                            .then(sub => {
                                //Case 1
                                if (sub) {
                                    jsonUser = {
                                        user_id: sub,
                                        email: u,
                                    };
                                }
                            })
                            .catch(e => {
                                if (JSON.parse(e).error !== "invalid_grant") {
                                    //Case 2
                                    console.log("u", u);
                                    jsonUser = u;
                                }
                            });

                        }

                    }));
                }
            });
            resolve(jsonUser);
        });
    }
}

My issue is that everything works fine.

My jsonUser contains exactly what I need but as it is asynchronous, the callback function (which is why I have to return) execute after my log console.log("Async too late");. This causes Auth0 to never take my callback response and fails.

Is there a way to actually wait for my callback to execute before continuing ?

EDIT

I can had a log to show what's happening :

3:17:07 PM:     new webtask request
3:17:07 PM:     jsonUser {}
3:17:07 PM:     finished webtask request
3:17:07 PM:     Trying DB 2
3:17:07 PM:     new webtask request
3:17:07 PM:     Redirecting is not possible in a 'oauth2-password' flow or when prompt=none. Skipping redirect.
3:17:07 PM:     finished webtask request
3:17:07 PM:     u {
user_id: '<user_id>',
email: '<email>'
}

EDIT 2

This is different from How do I return the response from an asynchronous call? as I do not have hands on what's calling the login function and cannot define things outside it.


问:
I have extraneous input ':' expecting 'end of line without line continuation'
```<code>// Define the trend based on the position of the moving average
if ema > ema[1]:
    trend = 'Up'
elif ema < ema[1]:
    trend = 'Down'
else:
    trend = 'Sideways'
</code>```

I try to use the colon (:) and indentation to indicate the start of a block of code but it does not work

```<code>if ema > ema[1]:
    trend = 'Up'
elif ema < ema[1]:
    trend = 'Down'
else:
    trend = 'Sideways'
</code>```

Compilation error. Line 10: mismatched input 'then' expecting 'end of line without line continuation'

Body:
// Define the trend based on the position of the moving average
if ema > ema[1]:
    trend = 'Up'
elif ema < ema[1]:
    trend = 'Down'
else:
    trend = 'Sideways'

I try to use the colon (:) and indentation to indicate the start of a block of code but it does not work

if ema > ema[1]:
    trend = 'Up'
elif ema < ema[1]:
    trend = 'Down'
else:
    trend = 'Sideways'

Compilation error. Line 10: mismatched input 'then' expecting 'end of line without line continuation'


问:
Android close testing - getting error of "Your device is not compatible with this version"
I have uploaded app on store in close testing.
I've become the tester of the app, but when I try to download app from my phone, it is saying me that "Your device is not compatible with this version"

I have some features that i want to test before publishing it on store for other users, so i have created one track with adding email id in testers in closed testing.

After track is released i have become the tester for the project wit WebLink and then i tried to download app from store, Then it is saying me that "Your device is not compatible with this version". It is showing my app name with (beta).

I've checked it is available for my country, Android version is also compatible with my phone. Also I have checked all the tester's team in Internal App Sharing Options.

It will be really helpful if someone can help me to sort my problem.

Here is my Manifest file snippets:

```<code><uses-feature
        android:glEsVersion="0x00020000"
        android:required="false" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission
        android:name="android.permission.BLUETOOTH"
        android:maxSdkVersion="31"
        tools:replace="android:maxSdkVersion"/>
    <uses-permission
        android:name="android.permission.BLUETOOTH_ADMIN"
        android:maxSdkVersion="31"
        tools:replace="android:maxSdkVersion"/>
    <uses-permission
        android:name="android.permission.BLUETOOTH_SCAN"
        android:usesPermissionFlags="neverForLocation"
        tools:targetApi="s" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.flash"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth_le"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth"
        android:required="false" />
</code>```

Body:
I have uploaded app on store in close testing.
I've become the tester of the app, but when I try to download app from my phone, it is saying me that "Your device is not compatible with this version"

I have some features that i want to test before publishing it on store for other users, so i have created one track with adding email id in testers in closed testing.

After track is released i have become the tester for the project wit WebLink and then i tried to download app from store, Then it is saying me that "Your device is not compatible with this version". It is showing my app name with (beta).

I've checked it is available for my country, Android version is also compatible with my phone. Also I have checked all the tester's team in Internal App Sharing Options.

It will be really helpful if someone can help me to sort my problem.

Here is my Manifest file snippets:

<uses-feature
        android:glEsVersion="0x00020000"
        android:required="false" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission
        android:name="android.permission.BLUETOOTH"
        android:maxSdkVersion="31"
        tools:replace="android:maxSdkVersion"/>
    <uses-permission
        android:name="android.permission.BLUETOOTH_ADMIN"
        android:maxSdkVersion="31"
        tools:replace="android:maxSdkVersion"/>
    <uses-permission
        android:name="android.permission.BLUETOOTH_SCAN"
        android:usesPermissionFlags="neverForLocation"
        tools:targetApi="s" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.flash"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth_le"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.bluetooth"
        android:required="false" />


问:
How can I validate PySpark Dataframe schema is obey to a particular structure?
I want to create a unit test that validates the Dataframe schema by comparing it to a particular schema structure I created, how can I do that?

For example, I have a df and schema -

```<code>schema = StructType([
    StructField("id",StringType(),True),
    StructField("name",StringType(),True)
 ])
</code>```

I want to validate that df.schema == schema

Body:
I want to create a unit test that validates the Dataframe schema by comparing it to a particular schema structure I created, how can I do that?

For example, I have a df and schema -

schema = StructType([
    StructField("id",StringType(),True),
    StructField("name",StringType(),True)
 ])

I want to validate that df.schema == schema


问:
Scrape javascript generated content in laravel 9
I have an website that loads an iframe through javacsript, now i want to fetch the content of the iframe in my php cron job how can i do that?

i already tried a few things like puphpeteer and jonnyw/php-phantomJS but both do not work with laravel 9.45.0


问:
Trying to add column with city names in dataframe based on columns that contains longitude and latitude/ or spatial join with shp file?
I have a csv file with 2 columns which contain long and lat location, but there is not one column wheres the city name is specified. To do so, I use python and I want to make a spatial join with a shp/shx file with every city from France.

The csv file looks like that :

index,date,position,long,lat,

421589,2020-08-06T10:35,48.491867 -1.5816984,48.491867,-1.5816984

Geo file :

https://wxs.ign.fr/x02uy2aiwjo9bm8ce5plwqmr/telechargement/prepackage/ADMINEXPRESS_SHP_TERRITOIRES_PACK_2022-11-21$ADMIN-EXPRESS_3-1__SHP_LAMB93_FXX_2022-11-21/file/ADMIN-EXPRESS_3-1__SHP_LAMB93_FXX_2022-11-21.7z

Does someone know to do so ?

Have a good day ! :)


问:
Debug reified Kotlin under SDK 25
I can not use the step by step tracing with reified functions, under Android SDK 25.

I create an emulator with SDK 29, everything is OK, i can put breakpoints and trace step by step.

I create an emulator with SDK 25, debug tracing is no longer available in reified function. I did the same test with a physical device running with Android 7.1.1, there is the same problème.

Under SDK 25 :

I put break points on line 13 and 18

When the debuger reachs the line 13, i press F7 (step in) or F8 or F5

The debuger jumps immediately to line 20 and never stop or enter the function test

```<code>1 class MainActivity : AppCompatActivity() {
2
3     private lateinit var appBarConfiguration: AppBarConfiguration
4     private lateinit var binding: ActivityMainBinding
5
6     override fun onCreate(savedInstanceState: Bundle?) {
7         super.onCreate(savedInstanceState)
8
9        binding = ActivityMainBinding.inflate(layoutInflater)
10        setContentView(binding.root)
11
12        binding.fab.setOnClickListener { view ->
13            test<String>("test")  // Call the inline function
14        }
15    }
16
17    inline fun <reified T : Any> test(value: T): Boolean {
18        return true
19    }
20 } // Debuger jumps here
</code>```

This peace of code is made for test, i got the same issue with more complex code.

Thank you.

Title: Debug reified Kotlin under SDK 25

Body:
I can not use the step by step tracing with reified functions, under Android SDK 25.

I create an emulator with SDK 29, everything is OK, i can put breakpoints and trace step by step.

I create an emulator with SDK 25, debug tracing is no longer available in reified function. I did the same test with a physical device running with Android 7.1.1, there is the same problème.

Under SDK 25 :

I put break points on line 13 and 18

When the debuger reachs the line 13, i press F7 (step in) or F8 or F5

The debuger jumps immediately to line 20 and never stop or enter the function test

1 class MainActivity : AppCompatActivity() {
2
3     private lateinit var appBarConfiguration: AppBarConfiguration
4     private lateinit var binding: ActivityMainBinding
5
6     override fun onCreate(savedInstanceState: Bundle?) {
7         super.onCreate(savedInstanceState)
8
9        binding = ActivityMainBinding.inflate(layoutInflater)
10        setContentView(binding.root)
11
12        binding.fab.setOnClickListener { view ->
13            test<String>("test")  // Call the inline function
14        }
15    }
16
17    inline fun <reified T : Any> test(value: T): Boolean {
18        return true
19    }
20 } // Debuger jumps here

This peace of code is made for test, i got the same issue with more complex code.

Thank you.


问:
SSR for dashboard apps
I'm developing a dashboard site with Next.js, which allows customization of a bunch of parameters, including date range, region etc. The data needs to be fetched based on these parameters, and is implemented by calling the endpoint again when state changes.

There is quite a lot of data (usually takes 6-ish seconds for the client to get), but there are times in production when the initial load of the page takes over 30 seconds. The chances of something else being wrong are hopefully high (so I can get these horrendous times down), but I wanted to use try to use SSR to render the page with the initial parameters, to at least speed it up a bit.

After some fiddling, this seems harder than I expected. Due to  "Error: Rendered more hooks than during the previous render" passing the initial state of the server and comparing it to the initial client state to prevent calling the endpoint we've already called isn't possible (I'm using RTKQuery, so the endpoint calls are hooks).

We already cache the endpoints, so that wouldn't be an issue, but we would pretty much be back to just CSR at that point right? Is there a use case for SSR in applications with "dynamic" data? If so, how would you go about implementing it?

Title: SSR for dashboard apps


问:
Need approach on how to write Button text based on nested multiple conditions , actions performed on each state of button
For Example , consider the shopping cart.

Button text will be displayed as "Get" item , when cart is empty & selected item is not purchased.(these may be multiple nested conditions)

Button text will be displayed as "Purchase more" item, if it's purchased && want to add more.

Button text will be displayed as "Download" , if its purchased successfully.

And respective action based on text.

To get button Text  used below code

```<code>const btnText = "GET";

if(condition1 && condition2 ){
   btnText = "Install"
} else if(abc(condition3 || condition4)){
    btnText = "Manage"
}else if(){
}else{
 btnText = "Purchase"
}
</code>```

To get button action

```<code>if(condition1 || condition 3){
dispatch(action)
} else if()
</code>```

I dont want this way either, where I tried with Map in Javascript & switch to perform actions on it.

```<code>const btnText = new Map()
       .set('Install',  condition1 && condition2)
       .set('Manage',abc(condition3 || condition4));
</code>```

But need better solution than this.
Which will be scalable and reliable so even if business scenario gets added easily add and read the code.

Which data structure to use instead of multiple conditions to avoid #sonarqube Refactor this function to reduce its Cognitive Complexity. ?

Otherwise which pattern to follow to write such code in #ReactJS , #JS.

Body:
For Example , consider the shopping cart.

Button text will be displayed as "Get" item , when cart is empty & selected item is not purchased.(these may be multiple nested conditions)

Button text will be displayed as "Purchase more" item, if it's purchased && want to add more.

Button text will be displayed as "Download" , if its purchased successfully.

And respective action based on text.

To get button Text  used below code

const btnText = "GET";

if(condition1 && condition2 ){
   btnText = "Install"
} else if(abc(condition3 || condition4)){
    btnText = "Manage"
}else if(){
}else{
 btnText = "Purchase"
}

To get button action

if(condition1 || condition 3){
dispatch(action)
} else if()

I dont want this way either, where I tried with Map in Javascript & switch to perform actions on it.

const btnText = new Map()
       .set('Install',  condition1 && condition2)
       .set('Manage',abc(condition3 || condition4));

But need better solution than this.
Which will be scalable and reliable so even if business scenario gets added easily add and read the code.

Which data structure to use instead of multiple conditions to avoid #sonarqube Refactor this function to reduce its Cognitive Complexity. ?

Otherwise which pattern to follow to write such code in #ReactJS , #JS.


问:
Can we add Permissions-Policy headers by using html meta tag?
I need to add Permissions-Policy Headers on master page by using Meta tags?
But i dont have clue that how to add it.I tried with below but dint work.</p>
```<code><meta http-equiv="Feature-Policy" content="ch-viewport-width *" src="javascript:'';" allow="geolocation 'src'">
</code>```

Body:
I need to add Permissions-Policy Headers on master page by using Meta tags?
But i dont have clue that how to add it.I tried with below but dint work.

<meta http-equiv="Feature-Policy" content="ch-viewport-width *" src="javascript:'';" allow="geolocation 'src'">


问:
Ingress Nginx Controller subpath to subpages on my website
I have a problem with configuring ingress nginx controller.

When I go to test.com/app1, my page appears with a link to the /public subpage (it should be test.com/app1/public), but when I click on the link it takes me to test.com/public. What should I add/change in my ingress configuration so that when I click on the link on the page it takes me to test.com/app1/public?

Currently my configuration looks like this.

```<code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:

- host: test.com
  http:
  paths:
  - backend:
    service:
    name: nginx-service-second
    port:
    number: 8081
    path: /app1(/|$)(.\*)
    pathType: Exact
</code>```

Body:
I have a problem with configuring ingress nginx controller.

When I go to test.com/app1, my page appears with a link to the /public subpage (it should be test.com/app1/public), but when I click on the link it takes me to test.com/public. What should I add/change in my ingress configuration so that when I click on the link on the page it takes me to test.com/app1/public?

Currently my configuration looks like this.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:

- host: test.com
  http:
  paths:
  - backend:
    service:
    name: nginx-service-second
    port:
    number: 8081
    path: /app1(/|$)(.\*)
    pathType: Exact


问:
Plotly Stacked Bar Chart: Different Coloring of Bars
I have created a stacked bar chart with Plotly for my Dash App, but I want to assign a different "color-scale" to each bar. There's 14 bars in total with subgroups of up till 14. The bar is depending on a range slider (years); it can show data from multiple years or one year only. When I choose one year, the code works fine and the bars are colored differently, but when more years are selected, it doesn't work as all bars gets the same color as defined for the first bar only.

I want something like this (three bars shown only): https://i.stack.imgur.com/G4g8X.png

But gets something like this when a time span is selected:
https://i.stack.imgur.com/376BS.png

Do anyone know how to fix it? :)