问:
Some APIs doesn't work In Next js on production
I have a project on Next js. It's working development correctly but when I deploy it some apis doesn't work.

backend api:
https://mutfakci.westhospital.az/api/blog

frontend blog:
https://front.westhospital.az/blog/1

blog page:

```<code>const Detail = ({ article }) => {
  console.log(article);
  return (
    <section id="blog_detail">
      <div className="container-fluid">
        <div className="row">
          <div className="col-lg-12 p-0">
            <div className="dtail_img">
              <img src="/FORWEB01 1 (1).png" alt="" />
            </div>
          </div>
        </div>
      </div>
      <BlogDetailMain article={article} />
      {/*    <LatesBlog/> */}
      <Coporation />
    </section>
  );
};

export default Detail;

export const getStaticProps = async (context) => {
  const res = await fetch(`${server}/api/blog/${context.params.id}`);

  const responseData = await res.json();

  const article = responseData.data;

  return {
    props: {
      article,
    },
  };
};

export const getStaticPaths = async () => {
  const res = await fetch(`${server}/api/blog`);

  const articlesResponse = await res.json();
  const articles = articlesResponse.data;

  const ids = articles.map((article) => article.id);
  const paths = ids.map((id) => ({ params: { id: id.toString() } }));

  return {
    paths,
    fallback: false,
  };
};
</code>```

My deploy file:- dep.js:

```<code>
const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')

const dev = process.env.NODE_ENV !== 'production'
const hostname = process.env.NODE_ENV !== "production" ? 'localhost' : 'front.westhospital.az'
const port = process.env.NODE_ENV || 5522
// when using middleware `hostname` and `port` must be provided below
const app = next({ dev, hostname, port })
const handle = app.getRequestHandler()

app.prepare().then(() => {
  createServer(async (req, res) => {
    try {
      // Be sure to pass `true` as the second argument to `url.parse`.
      // This tells it to parse the query portion of the URL.
      const parsedUrl = parse(req.url, true)
      const { pathname, query } = parsedUrl

      if (pathname === '/a') {
        await app.render(req, res, '/a', query)
      } else if (pathname === '/b') {
        await app.render(req, res, '/b', query)
      } else {
        await handle(req, res, parsedUrl)
      }
    } catch (err) {
      console.error('Error occurred handling', req.url, err)
      res.statusCode = 500
      res.end('internal server error')
    }
  }).listen(port, (err) => {
    if (err) throw err
    console.log(`> Ready on http://${hostname}:${port}`)
  })
})
</code>```

Next config file:

```<code>/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,

}

module.exports = nextConfig

</code>```

package.json file:

```<code>  "scripts": {
    "dev": "node dep.js",
    "build": "next build",
    "start": "NODE_ENV=production node dep.js"
  },
</code>```

I want to render my pages correctly on production.
Thanks.

Body:
I have a project on Next js. It's working development correctly but when I deploy it some apis doesn't work.

backend api:
https://mutfakci.westhospital.az/api/blog

frontend blog:
https://front.westhospital.az/blog/1

blog page:

const Detail = ({ article }) => {
  console.log(article);
  return (

      <BlogDetailMain article={article} />
      {/*    <LatesBlog/> */}
      <Coporation />

  );
};

export default Detail;

export const getStaticProps = async (context) => {
  const res = await fetch(`${server}/api/blog/${context.params.id}`);

  const responseData = await res.json();

  const article = responseData.data;

  return {
    props: {
      article,
    },
  };
};

export const getStaticPaths = async () => {
  const res = await fetch(`${server}/api/blog`);

  const articlesResponse = await res.json();
  const articles = articlesResponse.data;

  const ids = articles.map((article) => article.id);
  const paths = ids.map((id) => ({ params: { id: id.toString() } }));

  return {
    paths,
    fallback: false,
  };
};

My deploy file:- dep.js:

const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')

const dev = process.env.NODE_ENV !== 'production'
const hostname = process.env.NODE_ENV !== "production" ? 'localhost' : 'front.westhospital.az'
const port = process.env.NODE_ENV || 5522
// when using middleware `hostname` and `port` must be provided below
const app = next({ dev, hostname, port })
const handle = app.getRequestHandler()

app.prepare().then(() => {
  createServer(async (req, res) => {
    try {
      // Be sure to pass `true` as the second argument to `url.parse`.
      // This tells it to parse the query portion of the URL.
      const parsedUrl = parse(req.url, true)
      const { pathname, query } = parsedUrl

      if (pathname === '/a') {
        await app.render(req, res, '/a', query)
      } else if (pathname === '/b') {
        await app.render(req, res, '/b', query)
      } else {
        await handle(req, res, parsedUrl)
      }
    } catch (err) {
      console.error('Error occurred handling', req.url, err)
      res.statusCode = 500
      res.end('internal server error')
    }
  }).listen(port, (err) => {
    if (err) throw err
    console.log(`> Ready on http://${hostname}:${port}`)
  })
})

Next config file:

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,

}

module.exports = nextConfig

package.json file:

  "scripts": {
    "dev": "node dep.js",
    "build": "next build",
    "start": "NODE_ENV=production node dep.js"
  },

I want to render my pages correctly on production.
Thanks.


来源: stackexchange

问:
I cannot change the border color of antd table checkmark on hover
I want to change the checkmark border color to match the one i have set to the background but I cannot figure out how to do that because I am not able to find in the antd documentation and neither on inspecting the element on chrome.

I have attached a block of code and a screenshot of the problem. You can see the blue border around the "-" checkmark, removing the hover effect altogether also works for me.

enter image description here

```<code>\<div className="tableData"\>
{/\* \<Resizable\> \*/}
\<Table
ref={componentRef}
rowSelection={{
type: "checkbox",
columnTitle: "",
selectedRowKeys,
onChange: (selectedRowKeys, selectedRows) =\> {
setSelectedRowKeys(selectedRowKeys);
setSelectedRows(selectedRows);
},
}}
dataSource={dataSource}
columns={columns}
scroll={{ y: 400, x: 1120 }}
style={{ maxWidth: 1600 }}
rowClassName={(record) =\>
record.key % 2 === 0 ? "highlight_row" : ""
}
/\>
{/\* \</Resizable\> \*/}
\</div\>
</code>```

I tried using inspect elements on chrome and also did some research on antd docs but no luck.

ContentLicense: CC BY-SA 4.0

Body:
I want to change the checkmark border color to match the one i have set to the background but I cannot figure out how to do that because I am not able to find in the antd documentation and neither on inspecting the element on chrome.

I have attached a block of code and a screenshot of the problem. You can see the blue border around the "-" checkmark, removing the hover effect altogether also works for me.

enter image description here

\

{/\* \<Resizable\> \*/}
\
 {
setSelectedRowKeys(selectedRowKeys);
setSelectedRows(selectedRows);
},
}}
dataSource={dataSource}
columns={columns}
scroll={{ y: 400, x: 1120 }}
style={{ maxWidth: 1600 }}
rowClassName={(record) =\>
record.key % 2 === 0 ? "highlight_row" : ""
}
/\>
{/\* \</Resizable\> \*/}
\

I tried using inspect elements on chrome and also did some research on antd docs but no luck.


问:
Open multiple windows per time interval, using same long function, receiving different data with Python and PySimpleGui
I'm making a system that receives a list of login data (username and password), then opens each user and password in a window, consuming the same function that I receive as user and password parameters.

Below is a reduced example of what I'm doing.

```<code>from multiprocessing.dummy import Process
import PySimpleGUI as sg
from time import sleep
import threading
import concurrent.futures
from concurrent.futures import ThreadPoolExecutor
import multiprocessing as mp
from multiprocessing import Process
import os, json
from datetime import datetime, timezone
import time
import random

HOME = './Dados'

def current_location(self):
    geometry = self.TKroot.geometry()
    location = geometry[geometry.find('+') + 1:].split('+')
    x, y = int(location[0]), int(location[1])

    return(x, y+-30)

sg.Window.current_location = current_location

def function_thread(usuario, senha):
    global window
    window['output'].print(f'Login {usuario} e {senha}')

    for i in range(5):
        #print(f'Tarefas no perfil {usuario}')
        #window['output'].update(str('Tarefas no perfil {usuario}'))
        time.sleep(random.randint(1,2))
        horaatual = datetime.today().strftime('[%H:%M:%S:%f] - ')
        window['output'].print(horaatual+': Tarefas: '+ str(i))
        #sleep(2)
        #window.write_event_value('output', i)
    #window.write_event_value('output', usuario)
    window['output'].print(f'Completado {usuario}')
    #sleep(1)

x=-7
y=515
def abrir_abas():
    global x,y, usuario_insta, senha_insta
    window2 = None
    cont = 0
    #list_user = [('perfil1','senha1'),('perfil2', 'senha2'),('perfil3', 'senha3'),('perfil4', 'senha4'),('perfil5','senha5'),('perfil6', 'senha6'),('perfil7', 'senha7'),('perfil8', 'senha8')]
    '''
    executor = concurrent.futures.ProcessPoolExecutor(8)
    futures = [executor.submit(function_thread(group[0],group[1])for group in list_user)]
    concurrent.futures.wait(futures)
    '''
    with open(os.path.join(HOME, f'Config/abas.txt'), 'r') as f:
            abas = f.readlines()

    lista_conta = []
    for index_lista in range(len(abas)):
        abas[index_lista] = abas[index_lista].rstrip('\n')
        if abas[index_lista] != '' or None:
            lista_conta.append(abas[index_lista])

    #with concurrent.futures.ProcessPoolExecutor() as executor:

    for i_lista_conta in range(len(lista_conta)):
        qtd_lista_conta = int(len(lista_conta)/2)
        if i_lista_conta % 2 == 0:
            usuario = lista_conta[i_lista_conta].split(' ')
            usuario_insta = usuario[0]
            senha_insta = usuario[1]
            #self.output(usuario_insta, senha_insta)
            titulo = 'TAB '+usuario_insta
            window2 = output(usuario_insta, senha_insta, loc=(x,y))
            window2.TKroot.title(titulo)
            t1 = threading.Thread(target=function_thread(usuario_insta, senha_insta), daemon=True)
            t1.start()
            y=y+-30
            y=y
            cont = cont + 1

    '''
    processos = []
    for i_lista_conta in range(len(lista_conta)):
        qtd_lista_conta = int(len(lista_conta)/2)

        if i_lista_conta % 2 == 0:
            usuario_insta = lista_conta[i_lista_conta]
            senha_insta = lista_conta[i_lista_conta+1]
            #self.output(usuario_insta, senha_insta)
            titulo = 'TAB '+usuario_insta
            window2 = output(loc=(x,y))
            window2.TKroot.title(titulo)
            #threading.Thread(target=self.thread_acao(usuario_insta, senha_insta), daemon=True).start()
            p = Process(target=function_thread(usuario_insta, senha_insta))

            p.start()
            processos.append(p)

            y=y+-30
            y=y
            cont = cont + 1
    '''
    #for process in processos:
    #    process.join()

    '''
    for i in list_user:
        titulo = 'TAB '+i[0]
        #with concurrent.futures.ProcessPoolExecutor() as executor:
        #        window2 = executor.map(output(loc=(x,y)))
        window2 = output(loc=(x,y))
        window2.TKroot.title(titulo)

        #with concurrent.futures.ProcessPoolExecutor() as executor:
        #        executor.map(function_thread(i[0],i[1]))
        #threading.Thread(target=function_thread(i[0],i[1]), daemon=True).start()
        Process(target=function_thread(i[0],i[1])).start()
        y=y+-30
        y=y
        cont = cont + 1
        sleep(2)
    '''

def output(login, senha, loc=(-7, 515))->sg.Window:
    global window

    voltar = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF8WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az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_background_color(), sg.theme_background_color()), border_width=0)],
                [sg.Text('')],
                [sg.Button(image_data=voltar, key='voltar',tooltip="Voltar",button_color=(sg.theme_background_color(), sg.theme_background_color()), border_width=0)],
            ], k='c_v', visible=True)
    main_layout =[
            #[sg.Titlebar(title = texto, key = 'titulo')],
            [sg.StatusBar('O Rei Dos BOTs',justification='center', font='Arial 12')],
            [col_v,sg.Multiline(size=(20,2),expand_x=True, expand_y=True, key='output')],
            [sg.StatusBar('INICIANDO', k='status+', auto_size_text=True, justification='center', font=('Arial', 12, 'bold'), text_color='#FFFFFF', background_color=None, s=(None, 1))],
        ]

    window = sg.Window('ABA', size=(253,181), finalize=True, location=loc, background_color=None, auto_size_text=True, font='Arial 7', resizable=True, auto_size_buttons=False,right_click_menu = False, margins=(1, 1)).Layout(main_layout).Finalize()

    #with concurrent.futures.ProcessPoolExecutor() as executor:
    #    executor.map(function_thread(login, senha))
    return window

def main_output():
    global window, usuario_insta, senha_insta

    sg.theme('Topanga')
    layout = [  [sg.Text('Janela')],
                    [sg.Text(size=(10,1), key='-OUT-')],
                    [sg.Button('Executar'), sg.Button('Sair')],
                    [sg.StatusBar('INICIANDO', k='status', auto_size_text=True, justification='center', font='Arial 12', text_color='#FFFFFF', background_color=None, s=(None, 1))],
            ]

    window = sg.Window('Janela principal', layout, size=(253,181), use_default_focus=False,finalize=True, use_custom_titlebar=False, no_titlebar=False)

    while True:
        event, values = window.read()

        if event == sg.WIN_CLOSED or event == 'Sair':
            break

        if event == 'Executar':
            window.hide()
            #with ThreadPoolExecutor() as executor:
            #    executor.map(abrir_abas())
            #threading.Thread(target=abrir_abas(), daemon=True).start()
            abrir_abas()

            #threading.Thread(target=abrir_abas(), args=(window,), daemon=False).start()
            #with concurrent.futures.ProcessPoolExecutor() as executor:
            #    executor.map(abrir_abas())
        if event == 'Ok':
            print('Completado')

        if event == 'voltar':
            print('Voltar')

    window.close()

#threading.Thread(target=main_output(), args=(window,), daemon=True).start()
main_output()

</code>```

I can only do this by opening the first window and waiting for the function to complete and then opening the second window and so on.
The function is looping and can take more than 24 hours.

Body:
I'm making a system that receives a list of login data (username and password), then opens each user and password in a window, consuming the same function that I receive as user and password parameters.

Below is a reduced example of what I'm doing.

from multiprocessing.dummy import Process
import PySimpleGUI as sg
from time import sleep
import threading
import concurrent.futures
from concurrent.futures import ThreadPoolExecutor
import multiprocessing as mp
from multiprocessing import Process
import os, json
from datetime import datetime, timezone
import time
import random

HOME = './Dados'

def current_location(self):
    geometry = self.TKroot.geometry()
    location = geometry[geometry.find('+') + 1:].split('+')
    x, y = int(location[0]), int(location[1])

    return(x, y+-30)

sg.Window.current_location = current_location

def function_thread(usuario, senha):
    global window
    window['output'].print(f'Login {usuario} e {senha}')

    for i in range(5):
        #print(f'Tarefas no perfil {usuario}')
        #window['output'].update(str('Tarefas no perfil {usuario}'))
        time.sleep(random.randint(1,2))
        horaatual = datetime.today().strftime('[%H:%M:%S:%f] - ')
        window['output'].print(horaatual+': Tarefas: '+ str(i))
        #sleep(2)
        #window.write_event_value('output', i)
    #window.write_event_value('output', usuario)
    window['output'].print(f'Completado {usuario}')
    #sleep(1)

x=-7
y=515
def abrir_abas():
    global x,y, usuario_insta, senha_insta
    window2 = None
    cont = 0
    #list_user = [('perfil1','senha1'),('perfil2', 'senha2'),('perfil3', 'senha3'),('perfil4', 'senha4'),('perfil5','senha5'),('perfil6', 'senha6'),('perfil7', 'senha7'),('perfil8', 'senha8')]
    '''
    executor = concurrent.futures.ProcessPoolExecutor(8)
    futures = [executor.submit(function_thread(group[0],group[1])for group in list_user)]
    concurrent.futures.wait(futures)
    '''
    with open(os.path.join(HOME, f'Config/abas.txt'), 'r') as f:
            abas = f.readlines()

    lista_conta = []
    for index_lista in range(len(abas)):
        abas[index_lista] = abas[index_lista].rstrip('\n')
        if abas[index_lista] != '' or None:
            lista_conta.append(abas[index_lista])

    #with concurrent.futures.ProcessPoolExecutor() as executor:

    for i_lista_conta in range(len(lista_conta)):
        qtd_lista_conta = int(len(lista_conta)/2)
        if i_lista_conta % 2 == 0:
            usuario = lista_conta[i_lista_conta].split(' ')
            usuario_insta = usuario[0]
            senha_insta = usuario[1]
            #self.output(usuario_insta, senha_insta)
            titulo = 'TAB '+usuario_insta
            window2 = output(usuario_insta, senha_insta, loc=(x,y))
            window2.TKroot.title(titulo)
            t1 = threading.Thread(target=function_thread(usuario_insta, senha_insta), daemon=True)
            t1.start()
            y=y+-30
            y=y
            cont = cont + 1

    '''
    processos = []
    for i_lista_conta in range(len(lista_conta)):
        qtd_lista_conta = int(len(lista_conta)/2)

        if i_lista_conta % 2 == 0:
            usuario_insta = lista_conta[i_lista_conta]
            senha_insta = lista_conta[i_lista_conta+1]
            #self.output(usuario_insta, senha_insta)
            titulo = 'TAB '+usuario_insta
            window2 = output(loc=(x,y))
            window2.TKroot.title(titulo)
            #threading.Thread(target=self.thread_acao(usuario_insta, senha_insta), daemon=True).start()
            p = Process(target=function_thread(usuario_insta, senha_insta))

            p.start()
            processos.append(p)

            y=y+-30
            y=y
            cont = cont + 1
    '''
    #for process in processos:
    #    process.join()

    '''
    for i in list_user:
        titulo = 'TAB '+i[0]
        #with concurrent.futures.ProcessPoolExecutor() as executor:
        #        window2 = executor.map(output(loc=(x,y)))
        window2 = output(loc=(x,y))
        window2.TKroot.title(titulo)

        #with concurrent.futures.ProcessPoolExecutor() as executor:
        #        executor.map(function_thread(i[0],i[1]))
        #threading.Thread(target=function_thread(i[0],i[1]), daemon=True).start()
        Process(target=function_thread(i[0],i[1])).start()
        y=y+-30
        y=y
        cont = cont + 1
        sleep(2)
    '''

def output(login, senha, loc=(-7, 515))->sg.Window:
    global window

    voltar = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF8WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg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_v = sg.Column(
            [
                [sg.Button(image_data=pause, size=(None,20), key='Executar',button_color=(sg.theme_background_color(), sg.theme_background_color()), border_width=0)],
                [sg.Text('')],
                [sg.Button(image_data=voltar, key='voltar',tooltip="Voltar",button_color=(sg.theme_background_color(), sg.theme_background_color()), border_width=0)],
            ], k='c_v', visible=True)
    main_layout =[
            #[sg.Titlebar(title = texto, key = 'titulo')],
            [sg.StatusBar('O Rei Dos BOTs',justification='center', font='Arial 12')],
            [col_v,sg.Multiline(size=(20,2),expand_x=True, expand_y=True, key='output')],
            [sg.StatusBar('INICIANDO', k='status+', auto_size_text=True, justification='center', font=('Arial', 12, 'bold'), text_color='#FFFFFF', background_color=None, s=(None, 1))],
        ]

    window = sg.Window('ABA', size=(253,181), finalize=True, location=loc, background_color=None, auto_size_text=True, font='Arial 7', resizable=True, auto_size_buttons=False,right_click_menu = False, margins=(1, 1)).Layout(main_layout).Finalize()

    #with concurrent.futures.ProcessPoolExecutor() as executor:
    #    executor.map(function_thread(login, senha))
    return window

def main_output():
    global window, usuario_insta, senha_insta

    sg.theme('Topanga')
    layout = [  [sg.Text('Janela')],
                    [sg.Text(size=(10,1), key='-OUT-')],
                    [sg.Button('Executar'), sg.Button('Sair')],
                    [sg.StatusBar('INICIANDO', k='status', auto_size_text=True, justification='center', font='Arial 12', text_color='#FFFFFF', background_color=None, s=(None, 1))],
            ]

    window = sg.Window('Janela principal', layout, size=(253,181), use_default_focus=False,finalize=True, use_custom_titlebar=False, no_titlebar=False)

    while True:
        event, values = window.read()

        if event == sg.WIN_CLOSED or event == 'Sair':
            break

        if event == 'Executar':
            window.hide()
            #with ThreadPoolExecutor() as executor:
            #    executor.map(abrir_abas())
            #threading.Thread(target=abrir_abas(), daemon=True).start()
            abrir_abas()

            #threading.Thread(target=abrir_abas(), args=(window,), daemon=False).start()
            #with concurrent.futures.ProcessPoolExecutor() as executor:
            #    executor.map(abrir_abas())
        if event == 'Ok':
            print('Completado')

        if event == 'voltar':
            print('Voltar')

    window.close()

#threading.Thread(target=main_output(), args=(window,), daemon=True).start()
main_output()

I can only do this by opening the first window and waiting for the function to complete and then opening the second window and so on.
The function is looping and can take more than 24 hours.


问:
The current origin is not registered with the Google OAuth client
I'm trying to signup with the @react-oauth/google but is it not allowing me to signup.


问:
Setting Up Nsq - ASP.net
I am trying to set up nsq and broadcast a message to address=127.0.0.1:4161 but the message is not going through.

nsqd , nsqadmin and nsqlookup - are these services are up and running.

on starting the  nsqlookup for the confugured topic , i am getting error -> 404 querying nsqlookupd (127.0.0.1:4161) for topic VOC_notifications

enter image description here

Title: Setting Up Nsq - ASP.net


问:
How to make products display in two columns when in checkout
I have this code I added as shortcode to my checkout page. It allows to display product images from the cart. The problem is when user adds more than one product and the images are shown one after another in one column.

```<code>/* Product image shortcode @checkout */

function get_cart_products() {

    $bag_products = '<ul>';

    foreach( WC()->cart->get_cart() as $cart_item ){
        $product = wc_get_product( $cart_item['product_id'] );
        $bag_products .= $product->get_image() .'<a href="' . $product->get_permalink() . '"></a>';
    }

    $bag_products .= '</ul>';

    return $bag_products;
}

add_shortcode( 'bag_products', 'get_cart_products' );
</code>```

I am looking for help and solution on what can be added to this code to make images in two columns. I tried doing it with CSS, but did not achieve what I am looking for.

Body:
I have this code I added as shortcode to my checkout page. It allows to display product images from the cart. The problem is when user adds more than one product and the images are shown one after another in one column.

/* Product image shortcode @checkout */

function get_cart_products() {

    $bag_products = '
';

    foreach( WC()->cart->get_cart() as $cart_item ){
        $product = wc_get_product( $cart_item['product_id'] );
        $bag_products .= $product->get_image() .'get_permalink() . '">';
    }

    $bag_products .= '
';

    return $bag_products;
}

add_shortcode( 'bag_products', 'get_cart_products' );

I am looking for help and solution on what can be added to this code to make images in two columns. I tried doing it with CSS, but did not achieve what I am looking for.


问:
Plotly showing stacked values in Y-axis
I am beginner at using plotly and I am trying to plot a graph for a csv file. The graph must have a constant X axis values but the Y axis values changes for different column. The sample data for the graph is shared below for reference:

Column A
Column B
Column C

0
-1489.6275
-1489.6774

2
-1489.6273
-1489.6282

4
-1489.6085
-1489.6505

6
-1489.6267
-1489.6266

The kind of graph I would want would look like this (Sample Image showing different values of Y to a constant X-axis):

I tried running a simple code as below:

```<code>f1 = go.Figure(
    data = [
        go.Scatter(x=t, y=z0, name="first"),
        go.Scatter(x=t, y=z2, name ='s')
    ],
    layout = {"xaxis": {"title": "x axis"}, "yaxis": {"title": "y axis"}, "title": "My title"}
)
f1
</code>```

I got a graph like this:

The graph is stacking the values of the different columns I am trying to plot.

Title: Plotly showing stacked values in Y-axis

Body:
I am beginner at using plotly and I am trying to plot a graph for a csv file. The graph must have a constant X axis values but the Y axis values changes for different column. The sample data for the graph is shared below for reference:

Column A
Column B
Column C

0
-1489.6275
-1489.6774

2
-1489.6273
-1489.6282

4
-1489.6085
-1489.6505

6
-1489.6267
-1489.6266

The kind of graph I would want would look like this (Sample Image showing different values of Y to a constant X-axis):

I tried running a simple code as below:

f1 = go.Figure(
    data = [
        go.Scatter(x=t, y=z0, name="first"),
        go.Scatter(x=t, y=z2, name ='s')
    ],
    layout = {"xaxis": {"title": "x axis"}, "yaxis": {"title": "y axis"}, "title": "My title"}
)
f1

I got a graph like this:

The graph is stacking the values of the different columns I am trying to plot.


问:
AttachmentBuilder Discord.js V14
This error is keep coming and i don't know how to fix it. I have try look at similiar post but none of the solution work The error message my code is look like this

```<code>if(commandName === "download"){
        const {options} = interaction;
        if(options.getSubcommand() === "twitter"){
            const url = options.getString("link")
            try {
        const tweetID = getStatusID(url);
        const tweet = await getTweet(tweetID);
        const media = parseMedia(tweet);
        if (media.type === "video" || media.type === "animated_gif") {
            try {

                const videos = []
                media.media.forEach((p) => {
                    videos.push(new AttachmentBuilder().setFile(p.url).setDescription(`Video from ${media.user}`));
                })
                console.log(media.media)
                console.log(videos)
                await interaction.reply({content: `Videos from ${media.user}`, files: [...videos]});
            } catch (error1) {
                console.log(error1.message)
                interaction.reply("error while downloading tweet")
            }
        }

        if (media.type === "photo") {
            const photos = [];
            media.media.forEach((p) => {
                photos.push(new AttachmentBuilder().setFile(p.url).setDescription(`Photos from ${media.user}`));
            });
            console.log(photos)
            await interaction.reply({content: `Photos from ${media.user}`, files: [...photos]});
        }
        // await waitMsg.delete();
    } catch (error) {
        console.log("Failed to download tweet", error.message);
    }
        }
    }
</code>```

here my parseMedia function

```<code>function parseMedia(status) {
    const caption = status.text || status.full_text;
    const extendedEntities = status.extended_entities;
    let media = [];
    let type = '';
    if(extendedEntities && extendedEntities.media) {
    media = extendedEntities.media.map((obj) => {
        const tmp = {};
        type = obj.type;
        if(obj.type === 'video' || obj.type === 'animated_gif') {
            const videos = obj.video_info.variants;
            // console.log('videos', videos);
            let selectedVideo = videos;
            if (obj.type === 'video') {
            selectedVideo = videos.filter((f) => f.bitrate);
        }
        selectedVideo = selectedVideo.reduce((prev, current) => (prev.bitrate > current.bitrate) ? prev : current);
        tmp.type = obj.type;
        tmp.thumbnail = obj.media_url_https;
        tmp.url = selectedVideo.url;
        }

        if (obj.type === 'photo') {
        tmp.type = obj.type;
        tmp.thumbnail = obj.media_url_https;
        tmp.url = obj.media_url_https;
        }
        return tmp;
        });

        return {
        user: status.user.screen_name,
        caption,
        url: `https://twitter.com/${status.user.screen_name}/status/${status.id_str}`,
        type,
        media
        }
    }
    return false;
}
</code>```

I have tried to change into embed

```<code>if (media.type === "photo") {
            const photos = [];
            media.media.forEach((p) => {
                photos.push(new AttachmentBuilder().setFile(p.url).setDescription(`Photos from ${media.user}`));
            });
            console.log(photos)
            await interaction.reply({embeds: [...photos]});
        }
</code>```

but the bot just return the description enter image description here

here my console.log enter image description here

Title: AttachmentBuilder Discord.js V14

Body:
This error is keep coming and i don't know how to fix it. I have try look at similiar post but none of the solution work The error message my code is look like this

if(commandName === "download"){
        const {options} = interaction;
        if(options.getSubcommand() === "twitter"){
            const url = options.getString("link")
            try {
        const tweetID = getStatusID(url);
        const tweet = await getTweet(tweetID);
        const media = parseMedia(tweet);
        if (media.type === "video" || media.type === "animated_gif") {
            try {

                const videos = []
                media.media.forEach((p) => {
                    videos.push(new AttachmentBuilder().setFile(p.url).setDescription(`Video from ${media.user}`));
                })
                console.log(media.media)
                console.log(videos)
                await interaction.reply({content: `Videos from ${media.user}`, files: [...videos]});
            } catch (error1) {
                console.log(error1.message)
                interaction.reply("error while downloading tweet")
            }
        }

        if (media.type === "photo") {
            const photos = [];
            media.media.forEach((p) => {
                photos.push(new AttachmentBuilder().setFile(p.url).setDescription(`Photos from ${media.user}`));
            });
            console.log(photos)
            await interaction.reply({content: `Photos from ${media.user}`, files: [...photos]});
        }
        // await waitMsg.delete();
    } catch (error) {
        console.log("Failed to download tweet", error.message);
    }
        }
    }

here my parseMedia function

function parseMedia(status) {
    const caption = status.text || status.full_text;
    const extendedEntities = status.extended_entities;
    let media = [];
    let type = '';
    if(extendedEntities && extendedEntities.media) {
    media = extendedEntities.media.map((obj) => {
        const tmp = {};
        type = obj.type;
        if(obj.type === 'video' || obj.type === 'animated_gif') {
            const videos = obj.video_info.variants;
            // console.log('videos', videos);
            let selectedVideo = videos;
            if (obj.type === 'video') {
            selectedVideo = videos.filter((f) => f.bitrate);
        }
        selectedVideo = selectedVideo.reduce((prev, current) => (prev.bitrate > current.bitrate) ? prev : current);
        tmp.type = obj.type;
        tmp.thumbnail = obj.media_url_https;
        tmp.url = selectedVideo.url;
        }

        if (obj.type === 'photo') {
        tmp.type = obj.type;
        tmp.thumbnail = obj.media_url_https;
        tmp.url = obj.media_url_https;
        }
        return tmp;
        });

        return {
        user: status.user.screen_name,
        caption,
        url: `https://twitter.com/${status.user.screen_name}/status/${status.id_str}`,
        type,
        media
        }
    }
    return false;
}

I have tried to change into embed

if (media.type === "photo") {
            const photos = [];
            media.media.forEach((p) => {
                photos.push(new AttachmentBuilder().setFile(p.url).setDescription(`Photos from ${media.user}`));
            });
            console.log(photos)
            await interaction.reply({embeds: [...photos]});
        }

but the bot just return the description enter image description here

here my console.log enter image description here


问:
I want to fetch images from server i am using java servlets
I am trying to display images on client side without jsp because i am using ajax for request but i dont know how to do that.

I tried to convert that image to string and then send it to user using response. but i cant convert it to image on client side.


问:
I'm trying to post an employee along with his schedule to this trial site
I'm trying to use API's in order to

Login to site with my credentials

To register this employee in this company(x employee works for y company), and

Add his working schedule

```<code>using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;

using System.Net.Http.Formatting;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ConsoleApp3
{
    internal class Program
    {
        private class WTOS
        {
            public List<WTO> WTO { get; set; }
        }
        private class WTO
        {
            public string f_aa_pararthmatos { get; set; }
            public string f_rel_protocol { get; set; }
            public string f_rel_date { get; set; }
            public string f_comments { get; set; }
            public string f_from_date { get; set; }
            public string f_to_date { get; set; }
            public Ergazomenoi Ergazomenoi { get; set; }
        }
        private class Ergazomenoi
        {
            public List<ErgazomenosWTO> ErgazomenoiWTO { get; set; }
            public Ergazomenoi()
            {
                ErgazomenoiWTO = new List<ErgazomenosWTO>();
            }
        }
        private class ErgazomenosWTO
        {
            public string f_afm { get; set; }
            public string f_eponymo { get; set; }
            public string f_onoma { get; set; }
            public string f_date { get; set; }
            public ErgazomenosAnalytics ErgazomenosAnalytics { get; set; }

        }
        private class ErgazomenosAnalytics
        {
            public List<ErgazomenosWTOAnalytics> ErgazomenosWTOAnalytics { get; set; }
            public ErgazomenosAnalytics()
            {
                ErgazomenosWTOAnalytics = new List<ErgazomenosWTOAnalytics>();
            }
        }

        private class ErgazomenosWTOAnalytics
        {
            public string f_type { get; set; }
            public string f_from { get; set; }
            public string f_to { get; set; }
            public ErgazomenosWTOAnalytics() { }
        }
        private class Ergazomenos
        {
            public string f_afm { get; set; }
            public string f_eponymo { get; set; }
            public string f_onoma { get; set; }
            public string f_date { get; set; }
            public string f_working_time_digital_organization { get; set; }
            public string f_full_employment_hours { get; set; }
            public string f_week_days { get; set; }
            public string f_euelikto_wrario_minutes { get; set; }
            public string f_working_card { get; set; }
            public string f_dialeimma_minutes { get; set; }
            public string f_dialeimma_entos_wrariou { get; set; }
            public Ergazomenos() { }
        }
        private class Login
        {
            public string Username { get; set; }
            public string Password { get; set; }
            public string UserType { get; set; }

        }

        private class AccessToken
        {
            public string accessToken { get; set; }
            public int AccessTokenExpired { get; set; }
            public string RefreshToken { get; set; }
            public string RefreshTokenExpired { get; set; }
            public AccessToken() { }
        }

        private class Authenticate
        {
            public string Username { get; set; }
            public string Password { get; set; }
            public string Usertype { get; set; }
        }
        private class Cards
        {
            public CardsClass CardsCards { get; set; }
        }

        private class CardsClass
        {
            public List<Card> Card { get; set; }
        }
        private class Card
        {
            public string f_afm_ergodoti { get; set; }
            public string f_aa { get; set; }
            public string f_comments { get; set; }
            public Details Details { get; set; }
        }

        private class Details
        {
            public List<CardDetail> CardDetails { get; set; }
        }

        private class CardDetail
        {
            public string f_afm { get; set; }
            public string f_eponymo { get; set; }
            public string f_onoma { get; set; }
            public string f_type { get; set; }
            public DateTime f_reference_date { get; set; }
            public DateTime f_date { get; set; }
            public string f_aitiologia { get; set; }
        }

        public class Submission
        {
            public long Id { get; set; }
            public string Protocol { get; set; }
            public string SubmitDate { get; set; }
        }

        private class SubmissionsCode
        {

            public String Id { get; set; }
            public String Code { get; set; }
            public String Description { get; set; }
        }

        private static String GetAccessToken()
        {

            String sURL = "httpS://trialeservices.yeka.gr/WebServicesAPI/api/Authentication";

            Authenticate Auth = new Authenticate();
            Auth.Username = "ika0000ba5f";
            Auth.Password = "031263";
            Auth.Usertype = "01";
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(Auth);

            byte[] send = System.Text.Encoding.UTF8.GetBytes(jsonString);

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
            req.Method = "POST";
            req.ContentType = "application/json";
            req.ContentLength = send.Length;
            req.Accept = "application/json";

            Stream sout = req.GetRequestStream();
            sout.Write(send, 0, send.Length);
            sout.Flush();
            sout.Close();
            WebResponse response = req.GetResponse();

            Stream ReceiveStream = response.GetResponseStream();
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
            StreamReader readStream = new StreamReader(ReceiveStream, encode);
            string responseFromServer = readStream.ReadToEnd();

            dynamic JsonResponse = JsonConvert.DeserializeObject(responseFromServer);
            var AccessToken = JsonResponse.accessToken.ToString();

            return AccessToken;
        }

        private static String GetSubmissionCode(String token, String Description)
        {
            String Code = "";
            String sURL = "httpS://trialeservices.yeka.gr/WebServicesAPI/api/Lookup/Submissions";
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
            req.Method = "GET";
            req.ContentType = "application/json";
            req.Headers[HttpRequestHeader.Authorization] = "Bearer " + token;
            req.Accept = "application/json";

            WebResponse response = req.GetResponse();

            Stream ReceiveStream = response.GetResponseStream();
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
            StreamReader readStream = new StreamReader(ReceiveStream, encode);
            string responseFromServer = readStream.ReadToEnd();

            dynamic JsonResponse = JsonConvert.DeserializeObject(responseFromServer);
            //Console.WriteLine(responseFromServer);
            var SubmissionsCodes = JsonConvert.DeserializeObject<List<SubmissionsCode>>(responseFromServer);
            foreach (SubmissionsCode sCode in SubmissionsCodes)
            {
                String sCodeDescription = sCode.Description;
                if (sCodeDescription == Description)
                {
                    Code = sCode.Code;
                    break;
                }
            }
            return (Code);
        }

        private static Submission CreateNewSubmission(String token, String Code) {
            Submission nSubmission = new Submission();
            /*
            CardDetail nCardDetail = new CardDetail();
            nCardDetail.f_afm = "012345678";
            nCardDetail.f_eponymo = "ΚΑΠΟΙΟΣ";
            nCardDetail.f_onoma = "ΛΑΜΠΡΟΣ";
            nCardDetail.f_type = "0";
            nCardDetail.f_reference_date = DateTime.Now.Date;
            nCardDetail.f_date = DateTime.Now;
            nCardDetail.f_aitiologia = "aitiologia";

            List<CardDetail> CardDetail = new List<CardDetail>();
            CardDetail.Add(nCardDetail);
            Details nDetails = new Details();
            nDetails.CardDetails = CardDetail;

            Card nCard = new Card();
            nCard.f_afm_ergodoti = "012345678";
            nCard.f_aa = "0";
            nCard.f_comments = "test from REST API";
            nCard.Details = nDetails;

            List<Card> Card = new List<Card>();
            Card.Add(nCard);
            CardsClass nCardsClass = new CardsClass();
            nCardsClass.Card = Card;
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(Card);
            Console.WriteLine(jsonString);
            var jsonString2 = Newtonsoft.Json.JsonConvert.SerializeObject(nCard);
            Console.WriteLine(jsonString2);
            */

            String sURL = "https://trialeservices.yeka.gr/WebServicesAPI/api/Documents/" + Code;

            String postdata = "";
            postdata += "{";
            postdata += "\"Cards\": {";
            postdata += "\"Card\": [";
            postdata += "{";
            postdata += "\"f_afm_ergodoti\": \"094084006\",";
            postdata += "\"f_aa\": \"0\",";
            postdata += "\"f_comments\": \"test\",";
            postdata += "\"Details\": {";

            postdata += "\"CardDetails\": [";
            postdata += "{ \"f_afm\": \"161262385\",\"f_eponymo\": \"Λαζίδης\",\"f_onoma\": \"Αλέξανδρος\",\"f_type\": \"1\",\"f_reference_date\":\"2022-12-08T12:45:00\",\"f_date\": \"2022-12-08T12:45:00\",\"f_aitiologia\": \"\"}";

            postdata += "]";

            postdata += "}";
            postdata += "}";

            postdata += "]";

            postdata += "}";
            postdata += "}";
            Console.WriteLine(postdata);

            byte[] send = System.Text.Encoding.UTF8.GetBytes(postdata);

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
            req.Headers[HttpRequestHeader.Authorization] = "Bearer " + token;
            req.Method = "POST";
            req.ContentType = "application/json";
            req.ContentLength = send.Length;
            req.Accept = "application/json";

            Stream sout = req.GetRequestStream();
            sout.Write(send, 0, send.Length);
            sout.Flush();
            sout.Close();

            WebResponse response = req.GetResponse();

            /*
            Stream ReceiveStream = response.GetResponseStream();
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
            StreamReader readStream = new StreamReader(ReceiveStream, encode);
            string responseFromServer = readStream.ReadToEnd();

            dynamic JsonResponse = JsonConvert.DeserializeObject(responseFromServer);
            Console.WriteLine(JsonResponse);
            */
            return (nSubmission);
        }
        public static void SendOrario(string token)
        {
            var client = new HttpClient();
            var wtos = new WTOS();
            var wto = new WTO();
            var erganawto = new ErgazomenosWTOAnalytics();
            erganawto.f_from = "10:00";
            erganawto.f_to = "18:00";
            erganawto.f_type = "ΕΡΓ";
            var ergazomenosanalytics = new ErgazomenosAnalytics();
            ergazomenosanalytics.ErgazomenosWTOAnalytics.Add(erganawto);

            //var res = client.PostAsJsonAsync<WTOS>(url, login).Result;
        }

        static void Main(string[] args)
        {
            //Get Token
            String token = GetAccessToken();

            if (token!="") {
                //Get Submissions Code for new employee
                String Description = "Δήλωση έναρξης/λήξης εργασίας εργαζομένων";
                String Code = GetSubmissionCode(token, Description);
                Submission nSubmission = new Submission();
                if (Code!="") {

                    nSubmission = CreateNewSubmission(token, Code);

                }
                Console.WriteLine("Code = " + Code);
                //Console.WriteLine("SubmissionId = " + nSubmission.Id);
                Console.WriteLine("==============================");

            }
            Console.ReadLine();
        }
    }
}
</code>```

the json object the sites wants for the employee has the following schema :

```<code>{
"WTOS": {
"WTO":

{
"f_aa_pararthmatos": "0",
"f_rel_protocol": "",
"f_rel_date": "",
"f_comments": "",
"f_from_date": "13/12/2022",
"f_to_date": "13/12/2022",
"Ergazomenoi": {
"ErgazomenoiWTO":

{
"f_afm": "161262385",
"f_eponymo": "ΛΑΖΙΔΗΣ",
"f_onoma": "ΑΛΕΞΑΝΔΡΟΣ",
"f_date": "13/12/2022",
"ErgazomenosAnalytics": {
"ErgazomenosWTOAnalytics":

{
"f_type": "ΕΡΓ",
"f_from": "10:00",
"f_to": "18:30"
}

}
}

}
}

}
</code>```

and for his working schedule :

```<code>{
"WorkingStatusChanges": {
"WorkingStatusChange":
{
"f_aa_pararthmatos": "0",
"f_rel_protocol": "",
"f_rel_date": "",
"f_comments": "",
"Ergazomenoi": {
"Ergazomenos":
{
"f_afm": "161262385",
"f_eponymo": "ΛΑΖΙΔΗΣ",
"f_onoma": "ΑΛΕΞΑΝΔΡΟΣ",
"f_date": "12/12/2022",
"f_working_time_digital_organization": "1",
"f_full_employment_hours": "40,0",
"f_week_days": "5",
"f_euelikto_wrario_minutes": "0",
"f_working_card": "0",
"f_dialeimma_minutes": "30",
"f_dialeimma_entos_wrariou": "0"
},

}
}

}
}

</code>```

Code brokes, I got an error 400 at WebResponse response = req.GetResponse();
I also commented some lines such "CardDetail" because I dont want some classes for now

Body:
I'm trying to use API's in order to

Login to site with my credentials

To register this employee in this company(x employee works for y company), and

Add his working schedule

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;

using System.Net.Http.Formatting;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ConsoleApp3
{
    internal class Program
    {
        private class WTOS
        {
            public List<WTO> WTO { get; set; }
        }
        private class WTO
        {
            public string f_aa_pararthmatos { get; set; }
            public string f_rel_protocol { get; set; }
            public string f_rel_date { get; set; }
            public string f_comments { get; set; }
            public string f_from_date { get; set; }
            public string f_to_date { get; set; }
            public Ergazomenoi Ergazomenoi { get; set; }
        }
        private class Ergazomenoi
        {
            public List<ErgazomenosWTO> ErgazomenoiWTO { get; set; }
            public Ergazomenoi()
            {
                ErgazomenoiWTO = new List<ErgazomenosWTO>();
            }
        }
        private class ErgazomenosWTO
        {
            public string f_afm { get; set; }
            public string f_eponymo { get; set; }
            public string f_onoma { get; set; }
            public string f_date { get; set; }
            public ErgazomenosAnalytics ErgazomenosAnalytics { get; set; }

        }
        private class ErgazomenosAnalytics
        {
            public List<ErgazomenosWTOAnalytics> ErgazomenosWTOAnalytics { get; set; }
            public ErgazomenosAnalytics()
            {
                ErgazomenosWTOAnalytics = new List<ErgazomenosWTOAnalytics>();
            }
        }

        private class ErgazomenosWTOAnalytics
        {
            public string f_type { get; set; }
            public string f_from { get; set; }
            public string f_to { get; set; }
            public ErgazomenosWTOAnalytics() { }
        }
        private class Ergazomenos
        {
            public string f_afm { get; set; }
            public string f_eponymo { get; set; }
            public string f_onoma { get; set; }
            public string f_date { get; set; }
            public string f_working_time_digital_organization { get; set; }
            public string f_full_employment_hours { get; set; }
            public string f_week_days { get; set; }
            public string f_euelikto_wrario_minutes { get; set; }
            public string f_working_card { get; set; }
            public string f_dialeimma_minutes { get; set; }
            public string f_dialeimma_entos_wrariou { get; set; }
            public Ergazomenos() { }
        }
        private class Login
        {
            public string Username { get; set; }
            public string Password { get; set; }
            public string UserType { get; set; }

        }

        private class AccessToken
        {
            public string accessToken { get; set; }
            public int AccessTokenExpired { get; set; }
            public string RefreshToken { get; set; }
            public string RefreshTokenExpired { get; set; }
            public AccessToken() { }
        }

        private class Authenticate
        {
            public string Username { get; set; }
            public string Password { get; set; }
            public string Usertype { get; set; }
        }
        private class Cards
        {
            public CardsClass CardsCards { get; set; }
        }

        private class CardsClass
        {
            public List<Card> Card { get; set; }
        }
        private class Card
        {
            public string f_afm_ergodoti { get; set; }
            public string f_aa { get; set; }
            public string f_comments { get; set; }
            public Details Details { get; set; }
        }

        private class Details
        {
            public List<CardDetail> CardDetails { get; set; }
        }

        private class CardDetail
        {
            public string f_afm { get; set; }
            public string f_eponymo { get; set; }
            public string f_onoma { get; set; }
            public string f_type { get; set; }
            public DateTime f_reference_date { get; set; }
            public DateTime f_date { get; set; }
            public string f_aitiologia { get; set; }
        }

        public class Submission
        {
            public long Id { get; set; }
            public string Protocol { get; set; }
            public string SubmitDate { get; set; }
        }

        private class SubmissionsCode
        {

            public String Id { get; set; }
            public String Code { get; set; }
            public String Description { get; set; }
        }

        private static String GetAccessToken()
        {

            String sURL = "httpS://trialeservices.yeka.gr/WebServicesAPI/api/Authentication";

            Authenticate Auth = new Authenticate();
            Auth.Username = "ika0000ba5f";
            Auth.Password = "031263";
            Auth.Usertype = "01";
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(Auth);

            byte[] send = System.Text.Encoding.UTF8.GetBytes(jsonString);

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
            req.Method = "POST";
            req.ContentType = "application/json";
            req.ContentLength = send.Length;
            req.Accept = "application/json";

            Stream sout = req.GetRequestStream();
            sout.Write(send, 0, send.Length);
            sout.Flush();
            sout.Close();
            WebResponse response = req.GetResponse();

            Stream ReceiveStream = response.GetResponseStream();
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
            StreamReader readStream = new StreamReader(ReceiveStream, encode);
            string responseFromServer = readStream.ReadToEnd();

            dynamic JsonResponse = JsonConvert.DeserializeObject(responseFromServer);
            var AccessToken = JsonResponse.accessToken.ToString();

            return AccessToken;
        }

        private static String GetSubmissionCode(String token, String Description)
        {
            String Code = "";
            String sURL = "httpS://trialeservices.yeka.gr/WebServicesAPI/api/Lookup/Submissions";
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
            req.Method = "GET";
            req.ContentType = "application/json";
            req.Headers[HttpRequestHeader.Authorization] = "Bearer " + token;
            req.Accept = "application/json";

            WebResponse response = req.GetResponse();

            Stream ReceiveStream = response.GetResponseStream();
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
            StreamReader readStream = new StreamReader(ReceiveStream, encode);
            string responseFromServer = readStream.ReadToEnd();

            dynamic JsonResponse = JsonConvert.DeserializeObject(responseFromServer);
            //Console.WriteLine(responseFromServer);
            var SubmissionsCodes = JsonConvert.DeserializeObject<List<SubmissionsCode>>(responseFromServer);
            foreach (SubmissionsCode sCode in SubmissionsCodes)
            {
                String sCodeDescription = sCode.Description;
                if (sCodeDescription == Description)
                {
                    Code = sCode.Code;
                    break;
                }
            }
            return (Code);
        }

        private static Submission CreateNewSubmission(String token, String Code) {
            Submission nSubmission = new Submission();
            /*
            CardDetail nCardDetail = new CardDetail();
            nCardDetail.f_afm = "012345678";
            nCardDetail.f_eponymo = "ΚΑΠΟΙΟΣ";
            nCardDetail.f_onoma = "ΛΑΜΠΡΟΣ";
            nCardDetail.f_type = "0";
            nCardDetail.f_reference_date = DateTime.Now.Date;
            nCardDetail.f_date = DateTime.Now;
            nCardDetail.f_aitiologia = "aitiologia";

            List<CardDetail> CardDetail = new List<CardDetail>();
            CardDetail.Add(nCardDetail);
            Details nDetails = new Details();
            nDetails.CardDetails = CardDetail;

            Card nCard = new Card();
            nCard.f_afm_ergodoti = "012345678";
            nCard.f_aa = "0";
            nCard.f_comments = "test from REST API";
            nCard.Details = nDetails;

            List<Card> Card = new List<Card>();
            Card.Add(nCard);
            CardsClass nCardsClass = new CardsClass();
            nCardsClass.Card = Card;
            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(Card);
            Console.WriteLine(jsonString);
            var jsonString2 = Newtonsoft.Json.JsonConvert.SerializeObject(nCard);
            Console.WriteLine(jsonString2);
            */

            String sURL = "https://trialeservices.yeka.gr/WebServicesAPI/api/Documents/" + Code;

            String postdata = "";
            postdata += "{";
            postdata += "\"Cards\": {";
            postdata += "\"Card\": [";
            postdata += "{";
            postdata += "\"f_afm_ergodoti\": \"094084006\",";
            postdata += "\"f_aa\": \"0\",";
            postdata += "\"f_comments\": \"test\",";
            postdata += "\"Details\": {";

            postdata += "\"CardDetails\": [";
            postdata += "{ \"f_afm\": \"161262385\",\"f_eponymo\": \"Λαζίδης\",\"f_onoma\": \"Αλέξανδρος\",\"f_type\": \"1\",\"f_reference_date\":\"2022-12-08T12:45:00\",\"f_date\": \"2022-12-08T12:45:00\",\"f_aitiologia\": \"\"}";

            postdata += "]";

            postdata += "}";
            postdata += "}";

            postdata += "]";

            postdata += "}";
            postdata += "}";
            Console.WriteLine(postdata);

            byte[] send = System.Text.Encoding.UTF8.GetBytes(postdata);

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL);
            req.Headers[HttpRequestHeader.Authorization] = "Bearer " + token;
            req.Method = "POST";
            req.ContentType = "application/json";
            req.ContentLength = send.Length;
            req.Accept = "application/json";

            Stream sout = req.GetRequestStream();
            sout.Write(send, 0, send.Length);
            sout.Flush();
            sout.Close();

            WebResponse response = req.GetResponse();

            /*
            Stream ReceiveStream = response.GetResponseStream();
            System.Text.Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
            StreamReader readStream = new StreamReader(ReceiveStream, encode);
            string responseFromServer = readStream.ReadToEnd();

            dynamic JsonResponse = JsonConvert.DeserializeObject(responseFromServer);
            Console.WriteLine(JsonResponse);
            */
            return (nSubmission);
        }
        public static void SendOrario(string token)
        {
            var client = new HttpClient();
            var wtos = new WTOS();
            var wto = new WTO();
            var erganawto = new ErgazomenosWTOAnalytics();
            erganawto.f_from = "10:00";
            erganawto.f_to = "18:00";
            erganawto.f_type = "ΕΡΓ";
            var ergazomenosanalytics = new ErgazomenosAnalytics();
            ergazomenosanalytics.ErgazomenosWTOAnalytics.Add(erganawto);

            //var res = client.PostAsJsonAsync<WTOS>(url, login).Result;
        }

        static void Main(string[] args)
        {
            //Get Token
            String token = GetAccessToken();

            if (token!="") {
                //Get Submissions Code for new employee
                String Description = "Δήλωση έναρξης/λήξης εργασίας εργαζομένων";
                String Code = GetSubmissionCode(token, Description);
                Submission nSubmission = new Submission();
                if (Code!="") {

                    nSubmission = CreateNewSubmission(token, Code);

                }
                Console.WriteLine("Code = " + Code);
                //Console.WriteLine("SubmissionId = " + nSubmission.Id);
                Console.WriteLine("==============================");

            }
            Console.ReadLine();
        }
    }
}

the json object the sites wants for the employee has the following schema :

{
"WTOS": {
"WTO":

{
"f_aa_pararthmatos": "0",
"f_rel_protocol": "",
"f_rel_date": "",
"f_comments": "",
"f_from_date": "13/12/2022",
"f_to_date": "13/12/2022",
"Ergazomenoi": {
"ErgazomenoiWTO":

{
"f_afm": "161262385",
"f_eponymo": "ΛΑΖΙΔΗΣ",
"f_onoma": "ΑΛΕΞΑΝΔΡΟΣ",
"f_date": "13/12/2022",
"ErgazomenosAnalytics": {
"ErgazomenosWTOAnalytics":

{
"f_type": "ΕΡΓ",
"f_from": "10:00",
"f_to": "18:30"
}

}
}

}
}

}

and for his working schedule :

{
"WorkingStatusChanges": {
"WorkingStatusChange":
{
"f_aa_pararthmatos": "0",
"f_rel_protocol": "",
"f_rel_date": "",
"f_comments": "",
"Ergazomenoi": {
"Ergazomenos":
{
"f_afm": "161262385",
"f_eponymo": "ΛΑΖΙΔΗΣ",
"f_onoma": "ΑΛΕΞΑΝΔΡΟΣ",
"f_date": "12/12/2022",
"f_working_time_digital_organization": "1",
"f_full_employment_hours": "40,0",
"f_week_days": "5",
"f_euelikto_wrario_minutes": "0",
"f_working_card": "0",
"f_dialeimma_minutes": "30",
"f_dialeimma_entos_wrariou": "0"
},

}
}

}
}

Code brokes, I got an error 400 at WebResponse response = req.GetResponse();
I also commented some lines such "CardDetail" because I dont want some classes for now


问:
Using Nix on macOS how to install Python with pip?
nix-env -iA nixpkgs.python3Full

does not install pip3

nix-env -iA nixpkgs.python310Packages.pip

pip3 list
Package Version

pip     22.2.2
Logging error ---
Traceback (most recent call last):
File "/nix/store/6qxg1v3fvwr14llmkwyxxzdqvfz34m8s-python3.10-pip-22.2.2/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 177, in emit
self.console.print(renderable, overflow="ignore", crop=False, style=style)
File "/nix/store/6qxg1v3fvwr14llmkwyxxzdqvfz34m8s-python3.10-pip-22.2.2/lib/python3.10/site-packages/pip/_vendor/rich/console.py", line 1673, in print
extend(render(renderable, render_options))
File "/nix/store/6qxg1v3fvwr14llmkwyxxzdqvfz34m8s-python3.10-pip-22.2.2/lib/python3.10/site-packages/pip/_vendor/rich/console.py", line 1305, in render
for render_output in iter_render:
File "/nix/store/6qxg1v3fvwr14llmkwyxxzdqvfz34m8s-python3.10-pip-22.2.2/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 134, in rich_console
for line in lines:

.../...
File "/nix/store/70c1n7i4c90dn4iys0myy30yfxmlsza7-python3-3.10.8/lib/python3.10/logging/init.py", line 968, in handle
self.emit(record)
File "/nix/store/6qxg1v3fvwr14llmkwyxxzdqvfz34m8s-python3.10-pip-22.2.2/lib/python3.10/site-packages/pip/_internal/utils/logging.py", line 179, in emit
self.handleError(record)
Message: '[present-rich] %s'
Arguments: (UpgradePrompt(old='22.2.2', new='22.3.1'),)


问:
why get wrong current location in build release apk react native?
I don't know why in debug mode current location get correctly but when I build release apk for user test it getting wrong. I use this library => https://www.npmjs.com/package/react-native-geolocation-service</p>
```<code>// Get current devices location
import {Platform} from 'react-native';
import Permissions, {PERMISSIONS, RESULTS} from 'react-native-permissions';
import Geolocation from 'react-native-geolocation-service';
import Alert from '../src/components/Alert';

function GetCurrentLocation() {
  return new Promise(async resolve => {
    // Check whether user allow location permission or not
    // If user ditn't authorize then do nothing
    const type =
      Platform.OS === 'ios'
        ? PERMISSIONS.IOS.LOCATION_WHEN_IN_USE
        : PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION;
    const permission = await Permissions.request(type);
    if (permission !== RESULTS.GRANTED) {
      return resolve({latitude: null, longitude: null});
    }

    // After user authorized location permission
    // React Native Geolocation https://facebook.github.io/react-native/docs/geolocation
    Geolocation.getCurrentPosition(
      position => {
        const {latitude, longitude} = position.coords;
        resolve({latitude, longitude});
      },
      error => {
        // resolve({latitude: null, longitude: null});
        Alert.alertWithType('warn', 'Location', error.error, 3000);
      },
      {
        enableHighAccuracy: true,
        accuracy: {
          android: 'high',
          ios: 'best',
        },
        timeout: 15000,
        maximumAge: 10000,
        distanceFilter: 10,
      },
    );
  });
}

export default GetCurrentLocation;
</code>```

Body:
I don't know why in debug mode current location get correctly but when I build release apk for user test it getting wrong. I use this library => https://www.npmjs.com/package/react-native-geolocation-service

// Get current devices location
import {Platform} from 'react-native';
import Permissions, {PERMISSIONS, RESULTS} from 'react-native-permissions';
import Geolocation from 'react-native-geolocation-service';
import Alert from '../src/components/Alert';

function GetCurrentLocation() {
  return new Promise(async resolve => {
    // Check whether user allow location permission or not
    // If user ditn't authorize then do nothing
    const type =
      Platform.OS === 'ios'
        ? PERMISSIONS.IOS.LOCATION_WHEN_IN_USE
        : PERMISSIONS.ANDROID.ACCESS_COARSE_LOCATION;
    const permission = await Permissions.request(type);
    if (permission !== RESULTS.GRANTED) {
      return resolve({latitude: null, longitude: null});
    }

    // After user authorized location permission
    // React Native Geolocation https://facebook.github.io/react-native/docs/geolocation
    Geolocation.getCurrentPosition(
      position => {
        const {latitude, longitude} = position.coords;
        resolve({latitude, longitude});
      },
      error => {
        // resolve({latitude: null, longitude: null});
        Alert.alertWithType('warn', 'Location', error.error, 3000);
      },
      {
        enableHighAccuracy: true,
        accuracy: {
          android: 'high',
          ios: 'best',
        },
        timeout: 15000,
        maximumAge: 10000,
        distanceFilter: 10,
      },
    );
  });
}

export default GetCurrentLocation;


问:
Aggregate (concatenate, join, merge, zip, addrange) columns of two DataTables, but put a slash (or another sign) between them
Is it possible to aggregate columns of two DaTatables, but put a slash between them, please?

These are the DataTables:

TargetVariableList tdListCoreAggregated = tdListCore.Aggregated();

TargetVariableList tdListDivisionAggregated = tdListDivision.Aggregated();

I tried this below, but I suppose it is for a DataRow, not a DataTable, so it doesn't work.

```<code>DataTable dtCoreDivision = (DataTable)tdListCoreAggregated.Data.AsEnumerable()
.Zip(tdListDivisionAggregated.Data.AsEnumerable(), (a, b) => a + " | " + b);
</code>```

Simple Concat as below works, but it doesn't do what I want (no slash, of course):

```<code>DataTable dtCoreDivision = tdListCoreAggregated.Data.AsEnumerable()
.Concat(tdListDivisionAggregated.Data.AsEnumerable())
.CopyToDataTable();
</code>```

Or Merge:

```<code>tdListCoreAggregated.Data.Merge(tdListDivisionAggregated.Data);
</code>```

To be more specific: A new table can't be returned - I lost the data when I tried. Also, not only strings must be returned, but also integers.

In the very beginning, there is a stored procedure, a PostgreSQL function that returns a table with columns. One column contains data in JSON format. In order to use the data from this column for displaying e.g. in individual ComboBoxes, a table was created in the c# application, where both the original columns and the new columns with  the JSON data are present, as well as all occurring combinations. However, for the purpose of displaying selected columns in ComboBoxes, their rows were also aggregated. But now I needed to split that table with aggregated values into 2 according to a certain condition (the "ldsity_object_type_label_cz" column contains rows with "core" or "division" values, so according to that condition) and display the selected row of a certain column in the ComboBox as e.g.: version 1 + version 1 | version 1. (The original display is version 1 + version 1 + version 1).

I am also thinking to adjust the class with the original table (not divided into 2, yet, see the link below), but I'm not successful to write Where (something like ldsity_object_type_label_cz == "core" and  ldsity_object_type_label_cz == "division") there.

https://drive.google.com/file/d/100I_aKNMzTFVexzHOrvyQncgtgCgYDOj/view?usp=sharing

Picture of the original, undivided, extended table with all JSON data combinations:
extended table with all JSON data combinations

Picture of the original, undivided, extended table with aggregated rows:
extended table with aggregated rows

Body:
Is it possible to aggregate columns of two DaTatables, but put a slash between them, please?

These are the DataTables:

TargetVariableList tdListCoreAggregated = tdListCore.Aggregated();

TargetVariableList tdListDivisionAggregated = tdListDivision.Aggregated();

I tried this below, but I suppose it is for a DataRow, not a DataTable, so it doesn't work.

DataTable dtCoreDivision = (DataTable)tdListCoreAggregated.Data.AsEnumerable()
.Zip(tdListDivisionAggregated.Data.AsEnumerable(), (a, b) => a + " | " + b);

Simple Concat as below works, but it doesn't do what I want (no slash, of course):

DataTable dtCoreDivision = tdListCoreAggregated.Data.AsEnumerable()
.Concat(tdListDivisionAggregated.Data.AsEnumerable())
.CopyToDataTable();

Or Merge:

tdListCoreAggregated.Data.Merge(tdListDivisionAggregated.Data);

To be more specific: A new table can't be returned - I lost the data when I tried. Also, not only strings must be returned, but also integers.

In the very beginning, there is a stored procedure, a PostgreSQL function that returns a table with columns. One column contains data in JSON format. In order to use the data from this column for displaying e.g. in individual ComboBoxes, a table was created in the c# application, where both the original columns and the new columns with  the JSON data are present, as well as all occurring combinations. However, for the purpose of displaying selected columns in ComboBoxes, their rows were also aggregated. But now I needed to split that table with aggregated values into 2 according to a certain condition (the "ldsity_object_type_label_cz" column contains rows with "core" or "division" values, so according to that condition) and display the selected row of a certain column in the ComboBox as e.g.: version 1 + version 1 | version 1. (The original display is version 1 + version 1 + version 1).

I am also thinking to adjust the class with the original table (not divided into 2, yet, see the link below), but I'm not successful to write Where (something like ldsity_object_type_label_cz == "core" and  ldsity_object_type_label_cz == "division") there.

https://drive.google.com/file/d/100I_aKNMzTFVexzHOrvyQncgtgCgYDOj/view?usp=sharing

Picture of the original, undivided, extended table with all JSON data combinations:
extended table with all JSON data combinations

Picture of the original, undivided, extended table with aggregated rows:
extended table with aggregated rows


问:
Ntile impala not dividing groups of even size
I am using ntile function in impala to divide group of customers in equal size but it is not dividing in equal size. I am using below code :

`Table 1:

ColA, ColB, CustNo, Spend `

Data in table 1 is prepared at ColA, ColB, CustNo level.

Number of records in tabl1 is : 68555

My Code :

```<code>create table Table2 as
  Select distinct * from (
    Select *,
    ntile(10) over (partition by ColA,ColB
               order by Spend asc) as rank_10
    from Table1
  ) a
;
</code>```

When I am actually checking records for each decile I am not getting same records :

```<code>8|11931
6|4541
9|15048
7|9012
3|3118
4|3024
1|4635
5|2108
2|2847
10|12288
</code>```

Please suggest the mistake

Body:
I am using ntile function in impala to divide group of customers in equal size but it is not dividing in equal size. I am using below code :

`Table 1:

ColA, ColB, CustNo, Spend `

Data in table 1 is prepared at ColA, ColB, CustNo level.

Number of records in tabl1 is : 68555

My Code :

create table Table2 as
  Select distinct * from (
    Select *,
    ntile(10) over (partition by ColA,ColB
               order by Spend asc) as rank_10
    from Table1
  ) a
;

When I am actually checking records for each decile I am not getting same records :

8|11931
6|4541
9|15048
7|9012
3|3118
4|3024
1|4635
5|2108
2|2847
10|12288

Please suggest the mistake


问:
toggl multiple div-boxes without jquery
Toggle getelementbyid is not working without jquery

H guys,
at my site ive following div box

<div id="<?php echo $this->item->id; ?>" class="detail-box clearfix">

The ID is dynamic, not static, because ive many of these div-boxes. These div-boxes are display:none.

With jquery i had following div box to display the "hidden" one:

<div class="detail-toggle" onclick="toggle('<?php echo $this->item->id; ?>')">Mehr Infos

Is there a simple way to reproduce this with Vanilla or inline js?

Thx!

Title: toggl multiple div-boxes without jquery


问:
Is there a way of Vue transition to keep at the of transition end of the old component before new data loaded
As the title described.

Is there a way of Vue transition to keep at the of transition end of the old component before new data loaded ?

eg. some component, of 2 data model, show as 2 page. Using Vue transition, to remove the old component containing the old data model while AJAX loading the new data, then show the new component with newly loaded data model. ie. do the component switching transition and the AJAX loading at the same time, not to show the new component's entering transition before data loaded.

Want to keep the old component at transition end status, while waiting for the new data AJAX loading. Welcome answers.


问:
how to make switch case to execute block based on user input in pl sql
I would like to execute several instructions depending on the input of the user, like, if he enters 1 then we execute a block of code from another file, if he enters 2 then we execute another block of code, but I don't know how to start</p>
```<code>DBMS_OUTPUT.PUTLINE(********************************************************************);

DBMS_OUTPUT.PUTLINE("1-");
DBMS_OUTPUT.PUTLINE("2");

DECLARE

begin
select CHAR(1) =
 CASE '&select'
 WHEN 1 THEN @ConsulterListeVille.sql

end;
/
</code>```

Body:
I would like to execute several instructions depending on the input of the user, like, if he enters 1 then we execute a block of code from another file, if he enters 2 then we execute another block of code, but I don't know how to start

DBMS_OUTPUT.PUTLINE(********************************************************************);

DBMS_OUTPUT.PUTLINE("1-");
DBMS_OUTPUT.PUTLINE("2");

DECLARE

begin
select CHAR(1) =
 CASE '&select'
 WHEN 1 THEN @ConsulterListeVille.sql

end;
/


问:
Pickle vs. ply serialization
I want to serialize a collection of meshes (only vertices and faces). Is there any way to do it in one .ply file and, if so, is there any advantage of that approach over using pickle, if I am only going to access that file through python later when I need it?

Tried using trimesh for serialization, but only way is to concatenate meshes, but then I cannot view them as individual instances when I deserialize.

Title: Pickle vs. ply serialization


问:
Issue with addEventListener on click
I have issue with addEventListener on click, the problem is on first I have to click twice in order to show/hide the div. After the first click, the form is showing/hiding on every click. How can I fix this?

document.getElementById("setter-arrow-right").addEventListener("click", function() {
  if (document.getElementById("setter-container").style.width == "4vw") {
    document.getElementById("setter-container").style.width = "95vw";
    document.getElementById("setter-back").innerHTML = `<`;

    document.getElementById("scrap-container").style.display = "none";

  } else {
    document.getElementById("setter-container").style.width = "4vw"
    document.getElementById("setter-back").innerHTML = `>`;
    document.getElementById("scrap-container").style.display = "block";
  }
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="setter-scrap-container">
  <!-- Setter View -->
  <div id="setter-container">
    <!-- Button Right -->
    <div id="setter-arrow-right">
      <p>SETTER</p>
      <span id="setter-back">
        <p>></p>
      </span>
    </div>
  </div>
  <!-- Scrap View -->
  <div id="scrap-container">
    <!-- Button Left -->
    <div id="scrap-arrow-left">
      <p>SCRAP</p>
      <span id="scrap-back">
        <p><</p>
      </span>
    </div>
  </div>
</div></code>```

Title: Issue with addEventListener on click

Body:
I have issue with addEventListener on click, the problem is on first I have to click twice in order to show/hide the div. After the first click, the form is showing/hiding on every click. How can I fix this?

document.getElementById("setter-arrow-right").addEventListener("click", function() {
  if (document.getElementById("setter-container").style.width == "4vw") {
    document.getElementById("setter-container").style.width = "95vw";
    document.getElementById("setter-back").innerHTML = `<`;

    document.getElementById("scrap-container").style.display = "none";

  } else {
    document.getElementById("setter-container").style.width = "4vw"
    document.getElementById("setter-back").innerHTML = `>`;
    document.getElementById("scrap-container").style.display = "block";
  }
});

SETTER

>

SCRAP

<


问:
How to drag and drop element or click and hold mouse in Webdriverio V8?
I need to drag and drop element (option 2), but I thinks it doesn't work in webdriverio v8. The item is grabbed but not dropped, the test just hangs until I move the mouse. I would be grateful if you could suggest a solution.

I tried to use the standard function listed in the documentation:

```<code>await element2.dropAndDown(element1)
</code>```

or using the coordinates:

```<code>await element2.dragAndDrop({ x: 0, y: 20 })
</code>```

Also I tried this code:

```<code>await element2.moveTo();
await browser.buttonDown(0);
await element1.moveTo();
await browser.buttonUp(0);
</code>```

And after had an error

browser.buttonDown is not a function

Body:
I need to drag and drop element (option 2), but I thinks it doesn't work in webdriverio v8. The item is grabbed but not dropped, the test just hangs until I move the mouse. I would be grateful if you could suggest a solution.

I tried to use the standard function listed in the documentation:

await element2.dropAndDown(element1)

or using the coordinates:

await element2.dragAndDrop({ x: 0, y: 20 })

Also I tried this code:

await element2.moveTo();
await browser.buttonDown(0);
await element1.moveTo();
await browser.buttonUp(0);

And after had an error

browser.buttonDown is not a function


问:
Vscode watch for a single variable
The interactive window of vscode has a tab called Jupyter:Variables that allows me to watch on real time the variable of my code. However, sometimes there are too many variables or I just need to see in detail a single one on real time (that may be too long to display correctly in the Jupyter:Variables tab). Although double clicking on the variable allows me to see its contents, they are not automatically updated when I run another cell which defeats the purpose of having a watch.

Is there any way (integrated or with extensions) to have a watch for a single variable or a selection or variables in the interactive window, similar to the debugger watch (shown in the image)?

Title: Vscode watch for a single variable


问:
How to parse my string o/p of logs to JSON in fluentd
log": "2022-12-15 09:52:52 +0000 [info]: #0 disable filter chain optimization because [Fluent::Plugin::KubernetesMetadataFilter, Fluent::Plugin::RecordTransformerFilter] uses #filter_stream method.\n",

```</h1>
<p>I want to parse this in json format in fluentd for ex:
log:{
timestamp: 2022-12-15 09:52:52</p>
<h1>}</h1>
<h1>```


问:
How can I use a function like tf.TensorArray in Pytorch?
I need to change code from tensorflow to pytorch. Is there a similar function like tf.TensorArray?

For example:

```<code>iou_mask = tf.TensorArray(dtype=tf.float32, size=1, dynamic_size=True)
</code>```

Body:
I need to change code from tensorflow to pytorch. Is there a similar function like tf.TensorArray?

For example:

iou_mask = tf.TensorArray(dtype=tf.float32, size=1, dynamic_size=True)


问:
I have an error while working with label Img package
error :-- python: symbol lookup error: /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN22QWindowSystemInterface24setPlatformFiltersEventsEb, version Qt_5_PRIVATE_API
Environment details
OS ubuntu 20.04
Lang Python3.10.9
Env Jupyter Notebook
Things I have looked and tried so far
Topic 126011 in QT Forum
Git link
arch linux
And many more but still I have the same error........ :(
link to labelimg package

I want to solve this error
Please help me out
Thanks in advance


问:
How do I put the favicon on my demo website on Safari LiveServer?
Hope you're all well.

Recently, I started coding in visual studio code as I'll be changing my career to software development, and as I began with HTML and CSS, I stumbled upon a couple of issues.

The most irritating one so far is a favicon issue. I've done everything I can and favicon still won't show up on my demo website. I even cleared the cache, checked the route path before writing the code, but nothing would help.

I saved the favicon image in the folder named "images" in my main folder called VSCodeTraining. I put the following line under the  and still nothing happens:

<link rel="shortcut icon" href="images/favicon.png" type="image/png">

As I am working on a Mac, is there maybe something to do with the fact I'm not importing it from the Mac's main folder?

Thanks for your help in advance and sorry for the stupid question.


问:
Change font part of datalabels chart js
Only percentages should be bold

Datalabels is filled in via formatter

```<code> datalabels: {
      formatter: (value, ctx) => {
      //console.log(ctx)

     const test = ctx.chart.data.datasets[ctx.datasetIndex].data[ctx.dataIndex];
         if (test != '') {
           const test2 = test / sumlimitt * 100;
           return `${test2.toFixed(2)}%\n${test}`;
         }

         },
       //font: {
       //    weight: 'bold',
       //    size: 16,
       //}
     },
</code>```

Title: Change font part of datalabels chart js

Body:
Only percentages should be bold

Datalabels is filled in via formatter

 datalabels: {
      formatter: (value, ctx) => {
      //console.log(ctx)

     const test = ctx.chart.data.datasets[ctx.datasetIndex].data[ctx.dataIndex];
         if (test != '') {
           const test2 = test / sumlimitt * 100;
           return `${test2.toFixed(2)}%\n${test}`;
         }

         },
       //font: {
       //    weight: 'bold',
       //    size: 16,
       //}
     },


问:
Is there a way for a server to force visiting browsers to delete their browser-cache?
A client of ours runs a weather site (sort of) with URLs like www.weather-site.com/, www.weather-site.com/today, www.weather-site.com/tomorrow, www.weather-site.com/this-week, and www.weather-site.com/this-month.

The information on these sites changes daily, therefore we have set a cache expiration date of 24 hours:

```<code>cache-control: max-age={{seconds-until-midnight}}, must-revalidate
last-modified: {{start-of-day}}
</code>```

This week our client activated a CDN that overrode our cache-control-header with a new max-age of 30 days for all responses (HTML, JS, CSS, ...).

We already fixed this. But a lot of repeat visitors visited the site before our fix. Therefore, their browsers still show the "Monday versions" of these URLs and will continue to do so for the next ~30 days (until their browser accepts that the cached response got stale).

Since these repeat visitors are the most important ones for our client, this is a huge problem. Especially, because only a few of them will think about clearing their browser cache (it is not that easy for elderly users - especially on mobile).

My question: Is there anything we can do server-side that forces browsers to delete their caches (Especially if the affected users only visit those cached URLs and no fresh routes)?

Thank you for your help and ideas!

Body:
A client of ours runs a weather site (sort of) with URLs like www.weather-site.com/, www.weather-site.com/today, www.weather-site.com/tomorrow, www.weather-site.com/this-week, and www.weather-site.com/this-month.

The information on these sites changes daily, therefore we have set a cache expiration date of 24 hours:

cache-control: max-age={{seconds-until-midnight}}, must-revalidate
last-modified: {{start-of-day}}

This week our client activated a CDN that overrode our cache-control-header with a new max-age of 30 days for all responses (HTML, JS, CSS, ...).

We already fixed this. But a lot of repeat visitors visited the site before our fix. Therefore, their browsers still show the "Monday versions" of these URLs and will continue to do so for the next ~30 days (until their browser accepts that the cached response got stale).

Since these repeat visitors are the most important ones for our client, this is a huge problem. Especially, because only a few of them will think about clearing their browser cache (it is not that easy for elderly users - especially on mobile).

My question: Is there anything we can do server-side that forces browsers to delete their caches (Especially if the affected users only visit those cached URLs and no fresh routes)?

Thank you for your help and ideas!


问:
Check website ping status in NodeJS/ExpressJS
I am building an affiliate marketing tool in ExpressJS and MySQL where user adds a campaign/offer with multiple links with their respective traffic percentage, like:
abc.com -> 30%
xyz.com -> 70%

I want to check for each and every link in the db for it's ping status and when the website is down, the ping should get to 10 times, and when again the website is down, the user that added that link gets an email notification.

This whole function will run at intervals set by the user for each link. Like 1 hour or 2 hours.

I tried the code but its running massively and making unreasonable requests to the DB server because of too many connections.

My question is that how can I run this code without exhausting the db server?