问:
Getting error ‘You can only issue one request at a time’ when using react-native-nfc-manager
I have a project that reads and writes NFC tags in android and ios platforms.Both read and write are used inside one function.But I'm having a problem when I click the "Cancel" button on NFC prompt.

The first time the prompt shows up okay. After I click "Cancel" and try to write NFC tag again it says "You can only issue one request at a time" and after that it says "no reference available".               These errors are shown as alert messages.
After removing these alerts and try again to write nfc tag the NFC popup is displayed perfectly.

So basically when clicking the button to read/write NFC tag the first time it works, the second time it doesn’t work (shows the errors) and the third time it still works.

The code:

```<code>
const writeNdef = async function (profileToken) {

    if (Platform.OS !== 'ios') {
      promptRef.current.setVisible(true); // the android nfc popup
    }

    NfcManager.start();

    try {

      await NfcManager.requestTechnology(NfcTech.Ndef);

      // the resolved tag object will contain `ndefMessage` property

      const tag = await NfcManager.getTag();

      getSerialNumber(tag.id);

      if (isOwnedNfc === true) {

        const profileUrl = “my url here”;
        const bytes = Ndef.encodeMessage([Ndef.uriRecord(profileUrl)]);

        await NfcManager.ndefHandler.writeNdefMessage(bytes);

        setIsOwnedNfc(false);

        if (Platform.OS !== 'ios'){
          promptRef.current.setVisible(false);
        }

        Alert.alert (
          "",
          "Success",
          [{ text: "OK" }]
        );

      }

    } catch (ex) {

      if (Platform.OS !== 'ios') {
        promptRef.current.setVisible(false);
      }

      Alert.alert (
        "",
        ex.message.toString(),
        [{ text: "OK" }]
      );

    } finally {

      NfcManager.cancelTechnologyRequest();

      if (Platform.OS !== 'ios') {

        promptRef.current.setVisible(false);
      }
    }
}

</code>```

I was expecting the NfcManager.cancelTechnologyRequest() to stop the first NfcManager request.                                                                                I'm guessing that the 'Cancel' button doesn't cancel the request.

Body:
I have a project that reads and writes NFC tags in android and ios platforms.Both read and write are used inside one function.But I'm having a problem when I click the "Cancel" button on NFC prompt.

The first time the prompt shows up okay. After I click "Cancel" and try to write NFC tag again it says "You can only issue one request at a time" and after that it says "no reference available".               These errors are shown as alert messages.
After removing these alerts and try again to write nfc tag the NFC popup is displayed perfectly.

So basically when clicking the button to read/write NFC tag the first time it works, the second time it doesn’t work (shows the errors) and the third time it still works.

The code:

const writeNdef = async function (profileToken) {

    if (Platform.OS !== 'ios') {
      promptRef.current.setVisible(true); // the android nfc popup
    }

    NfcManager.start();

    try {

      await NfcManager.requestTechnology(NfcTech.Ndef);

      // the resolved tag object will contain `ndefMessage` property

      const tag = await NfcManager.getTag();

      getSerialNumber(tag.id);

      if (isOwnedNfc === true) {

        const profileUrl = “my url here”;
        const bytes = Ndef.encodeMessage([Ndef.uriRecord(profileUrl)]);

        await NfcManager.ndefHandler.writeNdefMessage(bytes);

        setIsOwnedNfc(false);

        if (Platform.OS !== 'ios'){
          promptRef.current.setVisible(false);
        }

        Alert.alert (
          "",
          "Success",
          [{ text: "OK" }]
        );

      }

    } catch (ex) {

      if (Platform.OS !== 'ios') {
        promptRef.current.setVisible(false);
      }

      Alert.alert (
        "",
        ex.message.toString(),
        [{ text: "OK" }]
      );

    } finally {

      NfcManager.cancelTechnologyRequest();

      if (Platform.OS !== 'ios') {

        promptRef.current.setVisible(false);
      }
    }
}

I was expecting the NfcManager.cancelTechnologyRequest() to stop the first NfcManager request.                                                                                I'm guessing that the 'Cancel' button doesn't cancel the request.


来源: stackexchange

问:
Cleaning data in an array method, not printing what it's supposed to?
Instructions

In SalesAnalyzer.java:
Write the cleanData() method.
Traverse the sales array and use Math.abs() to get the absolute value of each value in the array.
Return a new array that contains the corrected sales values.

In MyConsole.java:
Declare and initialize a new array called correctedSales that stores the array returned from the cleanData() method.
Print the values stored in the correctedSales array.

```<code>                               **The Code...**
</code>```

My Console.Java

```<code>public class MyConsole {
  public static void main(String[] args) {

    double[] sales = {-4.05, 5.06, 3.99, -3.99, -1.99, 2.05, 10.50, -7.85, 6.73, -8.45};
    SalesAnalyzer mySales = new SalesAnalyzer(sales);

    // TO DO #2: Call the cleanData() method.
double [] correctedSale = mySales.cleanData();
  System.out.println("\n\n \n");
//System.out.println(correctedSale);
    for(double c: correctedSale){  // that list top 30 low pop from getLowPopCountrie
     System.out.println(c);// supposed to cycle through array and print out new elements
      }
    // TO DO #3: Print the values stored in the new array
  }
}
</code>```

Sales Analyzer

```<code> Analyzes sales data for a business
 */
public class SalesAnalyzer {

  private double[] sales;  // The list of sales

  /*
   * Constructor to create a SalesAnalyzer
   * with the specified array of sales
   */
  public SalesAnalyzer(double[] sales) {
    this.sales = sales;
  }

  /*
   * Returns a new array containing corrected sales values
   */
  public double[] cleanData() {
    double[] cleanList= new double[sales.length];
    // TO DO #1: Return a new array containing the corrected sales values.
 //for(double values : sales){
   // double result = Math.abs(values);
   //}
 int track = 0; // tracking
 for(int index = 0; index< sales.length; index ++){ // cyling through array, starting @ first index
  // if(sales[index] < 15){ // current element less than 15
     if (track < sales.length){ // making sure both lists are the same length
       sales[track] = cleanList[index]; //aligning w new lisy
       cleanList[index] = Math.abs(index);
       track ++; // track out of 30
     } //brack 4 if 2
  // }// brack for if []
    //return cleanList;
  }
    return cleanList;
 }

}
</code>```

Original Array:{-4.05, 5.06, 3.99, -3.99, -1.99, 2.05, 10.50, -7.85, 6.73, -8.45};
Whats Printed:{0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0}
Has to be{4.05, 5.06, 3.99, 3.99, 1.99, 2.05, 10.50, 7.85, 6.73, 8.45};

ContentLicense: CC BY-SA 4.0

Body:
Instructions

In SalesAnalyzer.java:
Write the cleanData() method.
Traverse the sales array and use Math.abs() to get the absolute value of each value in the array.
Return a new array that contains the corrected sales values.

In MyConsole.java:
Declare and initialize a new array called correctedSales that stores the array returned from the cleanData() method.
Print the values stored in the correctedSales array.

                               **The Code...**

My Console.Java

public class MyConsole {
  public static void main(String[] args) {

    double[] sales = {-4.05, 5.06, 3.99, -3.99, -1.99, 2.05, 10.50, -7.85, 6.73, -8.45};
    SalesAnalyzer mySales = new SalesAnalyzer(sales);

    // TO DO #2: Call the cleanData() method.
double [] correctedSale = mySales.cleanData();
  System.out.println("\n\n \n");
//System.out.println(correctedSale);
    for(double c: correctedSale){  // that list top 30 low pop from getLowPopCountrie
     System.out.println(c);// supposed to cycle through array and print out new elements
      }
    // TO DO #3: Print the values stored in the new array
  }
}

Sales Analyzer

 Analyzes sales data for a business
 */
public class SalesAnalyzer {

  private double[] sales;  // The list of sales

  /*
   * Constructor to create a SalesAnalyzer
   * with the specified array of sales
   */
  public SalesAnalyzer(double[] sales) {
    this.sales = sales;
  }

  /*
   * Returns a new array containing corrected sales values
   */
  public double[] cleanData() {
    double[] cleanList= new double[sales.length];
    // TO DO #1: Return a new array containing the corrected sales values.
 //for(double values : sales){
   // double result = Math.abs(values);
   //}
 int track = 0; // tracking
 for(int index = 0; index< sales.length; index ++){ // cyling through array, starting @ first index
  // if(sales[index] < 15){ // current element less than 15
     if (track < sales.length){ // making sure both lists are the same length
       sales[track] = cleanList[index]; //aligning w new lisy
       cleanList[index] = Math.abs(index);
       track ++; // track out of 30
     } //brack 4 if 2
  // }// brack for if []
    //return cleanList;
  }
    return cleanList;
 }

}

Original Array:{-4.05, 5.06, 3.99, -3.99, -1.99, 2.05, 10.50, -7.85, 6.73, -8.45};
Whats Printed:{0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0}
Has to be{4.05, 5.06, 3.99, 3.99, 1.99, 2.05, 10.50, 7.85, 6.73, 8.45};


问:
Spring MVC (6.0.2) - dispatcher servlet not working (404 error)
I'm new in Spring but i've already made simple spring-mvc projects in spring 5, now i decided to choose new 6 version and do everything the same way, but it does not work.

SpringConfig.java:

```<code>@Configuration
@ComponentScan("org.example")
@EnableWebMvc
public class SpringConfig implements WebMvcConfigurer {

    private final ApplicationContext applicationContext;

    @Autowired
    public SpringConfig(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        // IT DOES NOT GO HERE!!!!
        ThymeleafViewResolver resolver = new ThymeleafViewResolver();
        resolver.setTemplateEngine(templateEngine());
        registry.viewResolver(resolver);
    }

    @Bean
    public SpringTemplateEngine templateEngine() {
        SpringTemplateEngine templateEngine = new SpringTemplateEngine();
        templateEngine.setTemplateResolver(templateResolver());
        templateEngine.setEnableSpringELCompiler(true);

        return templateEngine;
    }

    @Bean
    public SpringResourceTemplateResolver templateResolver() {
        SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
        templateResolver.setApplicationContext(applicationContext);
        templateResolver.setPrefix("/WEB-INF/views/");
        templateResolver.setSuffix(".html");

        return templateResolver;
    }
</code>```

MySpringMVCDispatcherServletInitializer.java:

```<code>public class MySpringMVCDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return null;
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] { SpringConfig.class };
    }

    @Override
    protected String[] getServletMappings() {
        return new String[] { "/" };
    }

    @Override
    public void onStartup(ServletContext aServletContext) throws ServletException {
        super.onStartup(aServletContext);
        registerHiddenFieldFilter(aServletContext);
    }

    private void registerHiddenFieldFilter(ServletContext aContext) {
        aContext.addFilter("hiddenHttpMethodFilter",
                new HiddenHttpMethodFilter()).addMappingForUrlPatterns(null ,true, "/*");
    }

}
</code>```

I can see that somehow "public void configureViewResolvers(ViewResolverRegistry registry)" is not getting called and as far as I understand it is the problem why no controller is working.
What should I do?

Body:
I'm new in Spring but i've already made simple spring-mvc projects in spring 5, now i decided to choose new 6 version and do everything the same way, but it does not work.

SpringConfig.java:

@Configuration
@ComponentScan("org.example")
@EnableWebMvc
public class SpringConfig implements WebMvcConfigurer {

    private final ApplicationContext applicationContext;

    @Autowired
    public SpringConfig(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        // IT DOES NOT GO HERE!!!!
        ThymeleafViewResolver resolver = new ThymeleafViewResolver();
        resolver.setTemplateEngine(templateEngine());
        registry.viewResolver(resolver);
    }

    @Bean
    public SpringTemplateEngine templateEngine() {
        SpringTemplateEngine templateEngine = new SpringTemplateEngine();
        templateEngine.setTemplateResolver(templateResolver());
        templateEngine.setEnableSpringELCompiler(true);

        return templateEngine;
    }

    @Bean
    public SpringResourceTemplateResolver templateResolver() {
        SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
        templateResolver.setApplicationContext(applicationContext);
        templateResolver.setPrefix("/WEB-INF/views/");
        templateResolver.setSuffix(".html");

        return templateResolver;
    }

MySpringMVCDispatcherServletInitializer.java:

public class MySpringMVCDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return null;
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] { SpringConfig.class };
    }

    @Override
    protected String[] getServletMappings() {
        return new String[] { "/" };
    }

    @Override
    public void onStartup(ServletContext aServletContext) throws ServletException {
        super.onStartup(aServletContext);
        registerHiddenFieldFilter(aServletContext);
    }

    private void registerHiddenFieldFilter(ServletContext aContext) {
        aContext.addFilter("hiddenHttpMethodFilter",
                new HiddenHttpMethodFilter()).addMappingForUrlPatterns(null ,true, "/*");
    }

}

I can see that somehow "public void configureViewResolvers(ViewResolverRegistry registry)" is not getting called and as far as I understand it is the problem why no controller is working.
What should I do?


问:
FreshWorks: Initiate a topic conditionally on FreshChat
I'm trying to set up FreshChat Topics and I'm lost. I need the front end to send a few params (user type, screen) to the server through an API. Using these params I need to decide which topic to initialise. But I'm not sure how topics can be initiated from the backend. Do I call a specific FreshChat API to do this or is this done in a different way? These topics also need to trigger a bot which I guess can be setup in FreshChats SDK.</p>


问:
Trying to display API Data in HTML - data.forEach is not a function
Could anyone please take a look, new to API and JavaScript really,

I am trying to display the thumbnail data from the API, however I keep getting the error below,

```<code>TypeError: data.forEach is not a function
    at index.js:9:18
    at async comics (index.js:4:22)
</code>```

Having read and watched a lot trying to figure it out, I thought I'd reach out to see if someone could show me and explain what I'm doing wrong.

currently using vanilla JS and have changed the key for this question, however consle.log shows data, I just cant make it appear in HTML.

```<code>async function comics() {

    const urlComic = await fetch("https://gateway.marvel.com:443/v1/public/comics?limit=100&apikey=85848598594594")
        .then(result => {
            return result.json();
        })
        .then(data => {
            data.forEach(comic => {
                const comicBook = `<img src=${comic.thumbnail} >`;

                document.querySelector(".imgContainer").insertAdjacentHTML("afterbegin", comicBook);
            });
        })

        .catch(error => console.log(error));
}

comics()
</code>```

I have tried researching as to why this isn't working but can't find the correct solution or tip to help me figure it out.

I am looking to generate the thumbnail data into an

Body:
Could anyone please take a look, new to API and JavaScript really,

I am trying to display the thumbnail data from the API, however I keep getting the error below,

TypeError: data.forEach is not a function
    at index.js:9:18
    at async comics (index.js:4:22)

Having read and watched a lot trying to figure it out, I thought I'd reach out to see if someone could show me and explain what I'm doing wrong.

currently using vanilla JS and have changed the key for this question, however consle.log shows data, I just cant make it appear in HTML.

async function comics() {

    const urlComic = await fetch("https://gateway.marvel.com:443/v1/public/comics?limit=100&apikey=85848598594594")
        .then(result => {
            return result.json();
        })
        .then(data => {
            data.forEach(comic => {
                const comicBook = `<img src=${comic.thumbnail} >`;

                document.querySelector(".imgContainer").insertAdjacentHTML("afterbegin", comicBook);
            });
        })

        .catch(error => console.log(error));
}

comics()

I have tried researching as to why this isn't working but can't find the correct solution or tip to help me figure it out.

I am looking to generate the thumbnail data into an


问:
Macro to open VBA editor
Is there a code that would open the VBA editor and find and replace text?

Even if it does not do find and replace, is there a code that would just open the VBA Editor?

Title: Macro to open VBA editor


问:
Can you identify the following optimization problem and method?
I have the following problem. I have a dataset containing three variables: Person, Actual Location (AL) and Preferred Location (PL).

```<code>dat <- data.frame(person_id = 1:100,
                  AL = sample(c("locA", "locB", "locC", "locD", "locE"), 100, replace = T),
                  PL = sample(c("locA", "locB", "locC", "locD", "locE"), 100, replace = T))
</code>```

AL is the location where that specific person is right now. PL is the location where that person wants to go to. The locations are identified as a categorical variable with n classes. AL represents the actual distribution of the locations, all possible locations are occupied. The distribution of PL does not need to match the distribution of AL, as long as the classes of PL are the same as AL.

Now I want to let as many people move to his PL, as possible. When someone moves, his AL becomes available for someone else, who has this location as his PL. If there are no AL's left for someone's PL, the person MUST stay in his AL and therefore his AL will never become available. The end result will be a set of chains of people who have switched locations to their preferences, and a set of people who have stayed in their AL.

Does anyone know the mathematical problem to this? At first I thought it was the Travelling Salesman Problem, but that is not the case here.

Body:
I have the following problem. I have a dataset containing three variables: Person, Actual Location (AL) and Preferred Location (PL).

dat <- data.frame(person_id = 1:100,
                  AL = sample(c("locA", "locB", "locC", "locD", "locE"), 100, replace = T),
                  PL = sample(c("locA", "locB", "locC", "locD", "locE"), 100, replace = T))

AL is the location where that specific person is right now. PL is the location where that person wants to go to. The locations are identified as a categorical variable with n classes. AL represents the actual distribution of the locations, all possible locations are occupied. The distribution of PL does not need to match the distribution of AL, as long as the classes of PL are the same as AL.

Now I want to let as many people move to his PL, as possible. When someone moves, his AL becomes available for someone else, who has this location as his PL. If there are no AL's left for someone's PL, the person MUST stay in his AL and therefore his AL will never become available. The end result will be a set of chains of people who have switched locations to their preferences, and a set of people who have stayed in their AL.

Does anyone know the mathematical problem to this? At first I thought it was the Travelling Salesman Problem, but that is not the case here.


问:
Onclick of a menu button to open and close sidebar not working when there is a breakPoint prop on the Sidebar using react pro sidebar
When I try to click the menu button to toggle the sidebar it does not work when the breakPoint prop is available

Global

```<code>const Global = () => {
  const [toggleSidebar, setToggleSidebar] = useState(true);
  const handleToggle = () => {
    setToggleSidebar((prev) => !prev);
    console.log("clicked");
  };
  return (
    <div className="flex">
      <Sidebarr toggleSidebar={toggleSidebar} />

      <div>
        <Topbar click={handleToggle} />
        <HomeDetails />
      </div>
    </div>
  );
};
</code>```

Topbar Component

```<code>import Image from "next/image";
import React, { useState } from "react";
import { AiOutlineMenu } from "react-icons/ai";
import { BsSearch } from "react-icons/bs";
import { IoNotifications } from "react-icons/io5";
import { useProSidebar } from "react-pro-sidebar";
import profileImg from "../../public/profileImg.jpeg";
import Sidebarr from "./Sidebar";

const Topbar = ({ click }) => {
  return (
    <div className="w-screen md:w-full">
      <div className="md:flex items-center w-full">
        <main
          className="hidden md:flex md:
        my-8 mx-[30rem]"
        >
          <label className="relative block">
            <div className="absolute inset-y-0 left-0 flex items-center pl-2">
              <BsSearch className="text-gray-500" />
            </div>
            <input
              className="placeholder:text-slate-400 block bg-gray-200 w-full border border-slate-300 rounded-md py-2 pl-9 pr-3 shadow-sm focus:outline-none focus:border-sky-500 focus:ring-sky-500 focus:ring-1 sm:text-sm"
              placeholder="Search"
              type="text"
              name="search"
            />
          </label>
        </main>
        <div className="flex items-center justify-between">
          <div className="md:hidden m-10 cursor-pointer" onClick={click}>
            <AiOutlineMenu />
          </div>
          <main className="flex items-center justify-between ">
            <div className="flex gap-4  items-center pr-7">
              <div className="flex flex-col items-end">
                <p className="bg-[#FF5630] h-4 w-4  text-center relative top-2 left-1  text-[10px] rounded-full text-white">
                  8
                </p>
                <IoNotifications className="text-gray-500 w-4 h-4" />
              </div>
              <Image
                src={profileImg}
                width={30}
                alt="profile-image"
                className="rounded-full"
              />
            </div>
          </main>
        </div>
      </div>
      <hr className="w-[83.5%] absolute left-50 top-24" />
    </div>
  );
};
</code>```

Sidebar Component

```<code>import React, { useEffect, useState } from "react";
import {
  Sidebar,
  Menu,
  MenuItem,
  SubMenu,
  useProSidebar,
} from "react-pro-sidebar";
import logo from "../../public/Logo.png";
import profileImg from "../../public/profileImg.jpeg";
import Image from "next/image";
import { SlHome, SlSettings } from "react-icons/sl";
import { BsGearWideConnected, BsPeople, BsPersonCheck } from "react-icons/bs";
import Link from "next/link";
import { Layers } from "react-feather";
import { CiDollar } from "react-icons/ci";
import { AiOutlineMenu } from "react-icons/ai";

const Sidebarr = ({ toggleSidebar, click }) => {
  const [activePage, setActivePage] = useState(null);

  const handleActive = (e) => {
    if (!e.target.classList.value.includes("active")) {
      e.target.classList.toggle("active");
      if (activePage) {
        activePage.classList.remove("active");
        setActivePage(e.target);
      }
    }
  };
  const [width, setWidth] = useState();
  const [collapse, setCollapse] = useState(false);
  // className={!toggleSidebar ? "block" : "hidden"}

  return (
    <>
      <div>
        { (
          <Sidebar
          breakPoint="md"
            // breakPoint={!toggleSidebar ? "" : "md"}
          >
            <div className="  h-screen md:table-cell">
              <div className="md:flex justify-center p-10">
                <Image src={logo} alt="logo" width={50} />
              </div>
              <div>
                <div className="flex p-5 items-center justify-center gap-4 bg-gray-200 mx-5 rounded-lg py-3 mb-10">
                  <Image
                    src={profileImg}
                    alt="profile-image"
                    width={30}
                    className="rounded-full"
                  />
                  <div className="flex flex-col">
                    <h4>Hudson Alvarez</h4>
                    <p className="text-gray-500">Admin</p>
                  </div>
                </div>
              </div>
              <Menu>
                <div className="flex flex-col text-gray-500">
                  <MenuItem
                    // active={window.location.pathname === "/adminDashboard/home"}
                    icon={<SlHome size={20} />}
                    routerLink={<Link href="/adminDashboard/home" />}
                  >
                    Home
                  </MenuItem>
                  <MenuItem
                    icon={<BsPeople size={20} />}
                    routerLink={<Link href="/adminDashboard/customers" />}
                    onClick={handleActive}
                  >
                    Customers
                  </MenuItem>
                  <SubMenu
                    label="Products"
                    icon={<Layers size={20} strokeWidth={1} />}
                  >
                    <MenuItem
                      // active={window.location.pathname === "/adminDashboard/kyc"}
                      routerLink={<Link href="/adminDashboard/kyc" />}
                    >
                      KYC
                    </MenuItem>
                    <MenuItem
                      // active={window.location.pathname === "/adminDashboard/connect"}
                      routerLink={<Link href="/adminDashboard/connect" />}
                    >
                      Connect
                    </MenuItem>
                    <MenuItem
                      // active={window.location.pathname === "/adminDashboard/insight"}
                      routerLink={<Link href="/adminDashboard/insight" />}
                    >
                      Insight
                    </MenuItem>
                  </SubMenu>
                  <MenuItem
                    // active={window.location.pathname === "/adminDashboard/revenue"}
                    icon={<CiDollar size={20} />}
                    routerLink={<Link href="/adminDashboard/revenue" />}
                  >
                    Revenue
                  </MenuItem>
                  <MenuItem
                    // active={window.location.pathname === "/adminDashboard/settings"}
                    icon={<SlSettings size={20} />}
                    routerLink={<Link href="/adminDashboard/adminSettings" />}
                  >
                    Settings
                  </MenuItem>
                </div>
              </Menu>
            </div>
          </Sidebar>
        )}
      </div>
    </>
  );
};

export default Sidebarr;

</code>```

I tried to use toggleSidebar state but still not getting it, I know someone would have run into this problem, if you have any answer that could help pls share

Body:
When I try to click the menu button to toggle the sidebar it does not work when the breakPoint prop is available

Global

const Global = () => {
  const [toggleSidebar, setToggleSidebar] = useState(true);
  const handleToggle = () => {
    setToggleSidebar((prev) => !prev);
    console.log("clicked");
  };
  return (

      <Sidebarr toggleSidebar={toggleSidebar} />

        <Topbar click={handleToggle} />
        <HomeDetails />

  );
};

Topbar Component

import Image from "next/image";
import React, { useState } from "react";
import { AiOutlineMenu } from "react-icons/ai";
import { BsSearch } from "react-icons/bs";
import { IoNotifications } from "react-icons/io5";
import { useProSidebar } from "react-pro-sidebar";
import profileImg from "../../public/profileImg.jpeg";
import Sidebarr from "./Sidebar";

const Topbar = ({ click }) => {
  return (

              <BsSearch className="text-gray-500" />

            <input
              className="placeholder:text-slate-400 block bg-gray-200 w-full border border-slate-300 rounded-md py-2 pl-9 pr-3 shadow-sm focus:outline-none focus:border-sky-500 focus:ring-sky-500 focus:ring-1 sm:text-sm"
              placeholder="Search"
              type="text"
              name="search"
            />

            <AiOutlineMenu />

                  8

                <IoNotifications className="text-gray-500 w-4 h-4" />

              <Image
                src={profileImg}
                width={30}
                alt="profile-image"
                className="rounded-full"
              />

  );
};

Sidebar Component

import React, { useEffect, useState } from "react";
import {
  Sidebar,
  Menu,
  MenuItem,
  SubMenu,
  useProSidebar,
} from "react-pro-sidebar";
import logo from "../../public/Logo.png";
import profileImg from "../../public/profileImg.jpeg";
import Image from "next/image";
import { SlHome, SlSettings } from "react-icons/sl";
import { BsGearWideConnected, BsPeople, BsPersonCheck } from "react-icons/bs";
import Link from "next/link";
import { Layers } from "react-feather";
import { CiDollar } from "react-icons/ci";
import { AiOutlineMenu } from "react-icons/ai";

const Sidebarr = ({ toggleSidebar, click }) => {
  const [activePage, setActivePage] = useState(null);

  const handleActive = (e) => {
    if (!e.target.classList.value.includes("active")) {
      e.target.classList.toggle("active");
      if (activePage) {
        activePage.classList.remove("active");
        setActivePage(e.target);
      }
    }
  };
  const [width, setWidth] = useState();
  const [collapse, setCollapse] = useState(false);
  // className={!toggleSidebar ? "block" : "hidden"}

  return (
    <>

        { (
          <Sidebar
          breakPoint="md"
            // breakPoint={!toggleSidebar ? "" : "md"}
          >

                <Image src={logo} alt="logo" width={50} />

                  <Image
                    src={profileImg}
                    alt="profile-image"
                    width={30}
                    className="rounded-full"
                  />

Hudson Alvarez

Admin

              <Menu>

                  <MenuItem
                    // active={window.location.pathname === "/adminDashboard/home"}
                    icon={<SlHome size={20} />}
                    routerLink={<Link href="/adminDashboard/home" />}
                  >
                    Home
                  </MenuItem>
                  <MenuItem
                    icon={<BsPeople size={20} />}
                    routerLink={<Link href="/adminDashboard/customers" />}
                    onClick={handleActive}
                  >
                    Customers
                  </MenuItem>
                  <SubMenu
                    label="Products"
                    icon={<Layers size={20} strokeWidth={1} />}
                  >
                    <MenuItem
                      // active={window.location.pathname === "/adminDashboard/kyc"}
                      routerLink={<Link href="/adminDashboard/kyc" />}
                    >
                      KYC
                    </MenuItem>
                    <MenuItem
                      // active={window.location.pathname === "/adminDashboard/connect"}
                      routerLink={<Link href="/adminDashboard/connect" />}
                    >
                      Connect
                    </MenuItem>
                    <MenuItem
                      // active={window.location.pathname === "/adminDashboard/insight"}
                      routerLink={<Link href="/adminDashboard/insight" />}
                    >
                      Insight
                    </MenuItem>
                  </SubMenu>
                  <MenuItem
                    // active={window.location.pathname === "/adminDashboard/revenue"}
                    icon={<CiDollar size={20} />}
                    routerLink={<Link href="/adminDashboard/revenue" />}
                  >
                    Revenue
                  </MenuItem>
                  <MenuItem
                    // active={window.location.pathname === "/adminDashboard/settings"}
                    icon={<SlSettings size={20} />}
                    routerLink={<Link href="/adminDashboard/adminSettings" />}
                  >
                    Settings
                  </MenuItem>

              </Menu>

          </Sidebar>
        )}

    </>
  );
};

export default Sidebarr;

I tried to use toggleSidebar state but still not getting it, I know someone would have run into this problem, if you have any answer that could help pls share


问:
Training Hidden Markov Chain model with different Mixture Gaussian emission distribution for different states
I am trying to train a Hidden Markov Chain model with different Mixuture Gaussian emission distribution for different states. What I want is the number of mixtures of gaussian for each state is different. For example, for state 1, the emission distribution has 3 mixed gaussian, for state 2, the emission distribution has 6 mixed gaussion.

However, I have tried the hmm.learn package and use GMMHMM class. class hmmlearn.hmm.GMMHMM(n_components=1, n_mix=1, min_covar=0.001, startprob_prior=1.0, transmat_prior=1.0, weights_prior=1.0, means_prior=0.0, means_weight=0.0, covars_prior=None, covars_weight=None, algorithm='viterbi', covariance_type='diag', random_state=None, n_iter=10, tol=0.01, verbose=False, params='stmcw', init_params='stmcw', implementation='log') It seems the n_mix here is set for all states. If I set n_mix = 3, after training, I got 3 mixtures gaussian for state 1 and 3 mixtures gaussian for state 2.

But what I am expecting is 3 mixtures gaussian for state 1, and 5 mixtures gaussian for state 2. Any hints for any pakcage/tools that can do this? python or matlab language is the best.


问:
Reading dynamic tableRows per Scrolling and test sorting function
i need to test a sorting function of a table. My problem is, that the developer implemented something like "lazy-loading" for the rows - the rows (div-elements of an ag-grid-table) only appears in the DOM, when they are in the view. So if you scroll through the table, the top elements disappear (even cant find the divs through dev-tools in chrome). Thats why i cant read all elements under the table and work with them - i need to scroll with my WebDriver through the table and read every row and write them into an array, where i can test, if the result is sorted.

```<code>
WebElement table = Helper.driver.findElement(By.xpath("hidden"));
Actions builder = new Actions(Helper.driver);

//here i read the total number of elements in the table from a string, which displayed the total number directly under the table
String totalNumberOfRows = Helper.driver.findElement(By.xpath("hidden")).getText();
int totalInt = Integer.parseInt(Arrays.asList(total.split(" ")).get(1));

String[] sortedTableColumn = new String[totalInt];
List<WebElement> tableRows = table.findElements(By.className("ag-row")); //all active Elements, which exist in the DOM at the point, where the user looks. Mostly around 15 elements (35 total in my example)

for(int i = 0; i<totalInt; i++) {

builder.moveToElement(tableRows.get(i)).perform(); //scroll through the elements
sortedTableColumn[i] = Arrays.asList(tableRows.get(i).getText().split(" ")).get(0); //dont ask, its necessary to get the first part of the string

        }
System.out.println(Arrays.toString(sortedTableColumn));
assertTrue(Ordering.natural().isOrdered(Arrays.asList(sortedTableColumn)));
</code>```

problem is, that the loop end with an error, because the tableRow has only 15 elements and the loop want to go further. Pretty understandable.
But I dont know how to handle this. I need something like "take the tableRows, go one step down (tableRows will change), put this new tableRows and the old ones in a new array and kill duplicates. AND be sure, that this is the new List, where i use the iterator "i".

Has anyone an idea to fix/complete my code or maybe a better way to test sorting funtions of dynamic loaded tables?

Body:
i need to test a sorting function of a table. My problem is, that the developer implemented something like "lazy-loading" for the rows - the rows (div-elements of an ag-grid-table) only appears in the DOM, when they are in the view. So if you scroll through the table, the top elements disappear (even cant find the divs through dev-tools in chrome). Thats why i cant read all elements under the table and work with them - i need to scroll with my WebDriver through the table and read every row and write them into an array, where i can test, if the result is sorted.

WebElement table = Helper.driver.findElement(By.xpath("hidden"));
Actions builder = new Actions(Helper.driver);

//here i read the total number of elements in the table from a string, which displayed the total number directly under the table
String totalNumberOfRows = Helper.driver.findElement(By.xpath("hidden")).getText();
int totalInt = Integer.parseInt(Arrays.asList(total.split(" ")).get(1));

String[] sortedTableColumn = new String[totalInt];
List<WebElement> tableRows = table.findElements(By.className("ag-row")); //all active Elements, which exist in the DOM at the point, where the user looks. Mostly around 15 elements (35 total in my example)

for(int i = 0; i<totalInt; i++) {

builder.moveToElement(tableRows.get(i)).perform(); //scroll through the elements
sortedTableColumn[i] = Arrays.asList(tableRows.get(i).getText().split(" ")).get(0); //dont ask, its necessary to get the first part of the string

        }
System.out.println(Arrays.toString(sortedTableColumn));
assertTrue(Ordering.natural().isOrdered(Arrays.asList(sortedTableColumn)));

problem is, that the loop end with an error, because the tableRow has only 15 elements and the loop want to go further. Pretty understandable.
But I dont know how to handle this. I need something like "take the tableRows, go one step down (tableRows will change), put this new tableRows and the old ones in a new array and kill duplicates. AND be sure, that this is the new List, where i use the iterator "i".

Has anyone an idea to fix/complete my code or maybe a better way to test sorting funtions of dynamic loaded tables?


问:
Multi-threading issue with selenium
I currently need to do an automated work, and I want to speed up using threadings
However, the issue is that when I start 2 threads or more, the program will automatically closes until it reached 1 thread.
Any solution to this?.

```<code>from time import sleep
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.common.exceptions import TimeoutException
import random
import threading

def ChromeMetamask():
    options = ChromeOptions()
    options.add_extension("metaMaskextension.crx")
    ChromeMetamask.web = webdriver.Chrome(chrome_options=options)
    return ChromeMetamask.web

def StreamTeam():
    ...
    ChromeMetamask.web.quit()

def run(x):
    print("Running thread" ,x)
    sleep(x)
    while True:
        try:
            ChromeMetamask()
            print("Creating wallet of thread" ,x)
            CreateWallet()
            print("Working on thread" ,x)
            StreamTeam()
            print("Thread " + str(x) + " has completed")
        except Exception as e:
            print("Thread " + str(x) + " encounters an error, restarting")
            continue

if __name__ == "__main__":
    thread = int(input("Enter number of threads: "))
    threads = []
    for x in range(1,thread+1):
        threads += [threading.Thread(target = run, args ={x}, )]
    for t in threads:
        t.start()
    for t in threads:
        t.join()

</code>```

Title: Multi-threading issue with selenium

Body:
I currently need to do an automated work, and I want to speed up using threadings
However, the issue is that when I start 2 threads or more, the program will automatically closes until it reached 1 thread.
Any solution to this?.

from time import sleep
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.common.exceptions import TimeoutException
import random
import threading

def ChromeMetamask():
    options = ChromeOptions()
    options.add_extension("metaMaskextension.crx")
    ChromeMetamask.web = webdriver.Chrome(chrome_options=options)
    return ChromeMetamask.web

def StreamTeam():
    ...
    ChromeMetamask.web.quit()

def run(x):
    print("Running thread" ,x)
    sleep(x)
    while True:
        try:
            ChromeMetamask()
            print("Creating wallet of thread" ,x)
            CreateWallet()
            print("Working on thread" ,x)
            StreamTeam()
            print("Thread " + str(x) + " has completed")
        except Exception as e:
            print("Thread " + str(x) + " encounters an error, restarting")
            continue

if __name__ == "__main__":
    thread = int(input("Enter number of threads: "))
    threads = []
    for x in range(1,thread+1):
        threads += [threading.Thread(target = run, args ={x}, )]
    for t in threads:
        t.start()
    for t in threads:
        t.join()


问:
Binary Search - A list of filenames from a different list of files
I am trying to implement a Binary Search in Python. I have two lists,
list1 = [filename1-10-22, filename2-10-22, filename3-10-22] and
list2 = [filename1-9-22, filename2-9-22, filename3-9-22, filename1-10-22, filename2-10-22, filename3-10-22]
And I want to search the files present in both the lists and add it in a separate list.
This is the Code I have so far:

```<code>    list1 = [filename1-10-22, filename2-10-22, filename3-10-22]
    list2 = [filename1-9-22, filename2-9-22, filename3-9-22, filename1-10-22, filename2-10-22, filename3-10-22]
    xmls_already_processed_list = []
    new_files_check_list = []
    for fileName in list1:
     start = 0
     end = len(list2) - 1
     while start <= end:
         middle = (start + end)// 2
         midpoint = list2[middle]
         if midpoint == fileName:
          xmls_already_processed_list.append((filePath,fileName))
         elif midpoint > fileName:
          end = middle - 1
         elif midpoint < fileName:
          start = middle + 1
         else:
          new_files_check_list.append(fileName)
</code>```

I am unable to filter the files, and I dont want to use a linear search because it is an extensive operation because the length of lists will increase in coming days.

Body:
I am trying to implement a Binary Search in Python. I have two lists,
list1 = [filename1-10-22, filename2-10-22, filename3-10-22] and
list2 = [filename1-9-22, filename2-9-22, filename3-9-22, filename1-10-22, filename2-10-22, filename3-10-22]
And I want to search the files present in both the lists and add it in a separate list.
This is the Code I have so far:

    list1 = [filename1-10-22, filename2-10-22, filename3-10-22]
    list2 = [filename1-9-22, filename2-9-22, filename3-9-22, filename1-10-22, filename2-10-22, filename3-10-22]
    xmls_already_processed_list = []
    new_files_check_list = []
    for fileName in list1:
     start = 0
     end = len(list2) - 1
     while start <= end:
         middle = (start + end)// 2
         midpoint = list2[middle]
         if midpoint == fileName:
          xmls_already_processed_list.append((filePath,fileName))
         elif midpoint > fileName:
          end = middle - 1
         elif midpoint < fileName:
          start = middle + 1
         else:
          new_files_check_list.append(fileName)

I am unable to filter the files, and I dont want to use a linear search because it is an extensive operation because the length of lists will increase in coming days.


问:
Python Binance retrieve crypto prices and post them to a discord
So i'm trying to create a python bot with ccxt and discord.py for discord which gets the prices for crypto from binance and post them to a channel in a discord server which i made for tests.

This is only intended for learning btw.

```<code>import discord
import ccxt
import time

client = discord.Client(intents=discord.Intents.default())

@client.event
async def on_ready():
    print('Bot is ready!')

def get_prices(cryptocurrencies, tickers):
    prices = {}
    for cryptocurrency in cryptocurrencies:
        prices[cryptocurrency] = tickers[cryptocurrency]['last']
    print(prices)
    return prices

@client.event
async def on_message(message):
    if message.content == '!prices':
        # Create a Binance client
        binance = ccxt.binance({
            'apiKey': 'zzzz',
            'secret': 'zzzz',
            'enableRateLimit': True,
        })

        # Get the list of cryptocurrencies
        cryptocurrencies = ['BTC/USDT', 'ETH/USDT', 'XRP/USDT']

        # Get the Discord text channel named "crypto-test"
        channel = discord.utils.get(message.guild.channels, name='crypto-test')

        while True:
            # Get the current prices of all cryptocurrencies
            tickers = binance.fetch_tickers()

            # Get the prices of the specified cryptocurrencies
            prices = get_prices(cryptocurrencies, tickers)

            # Post the prices to the Discord text channel
            for cryptocurrency, price in prices.items():
                await channel.send(f'{cryptocurrency}: {price}')

            # Wait for 5 seconds before updating the prices again
            time.sleep(5)

client.run('DISCORD_BOT_TOKEN')
</code>```

After the bot says that's ready, nothing happens.
I've added also prints and so on, still no info on it.

```<code>2022-12-08 14:57:25 INFO     discord.client logging in using static token
2022-12-08 14:57:27 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: zzzz).
Bot is ready!
</code>```

Any ideas ?
Trying to learn python and create a small bot, but seems i still have things to learn.

Body:
So i'm trying to create a python bot with ccxt and discord.py for discord which gets the prices for crypto from binance and post them to a channel in a discord server which i made for tests.

This is only intended for learning btw.

import discord
import ccxt
import time

client = discord.Client(intents=discord.Intents.default())

@client.event
async def on_ready():
    print('Bot is ready!')

def get_prices(cryptocurrencies, tickers):
    prices = {}
    for cryptocurrency in cryptocurrencies:
        prices[cryptocurrency] = tickers[cryptocurrency]['last']
    print(prices)
    return prices

@client.event
async def on_message(message):
    if message.content == '!prices':
        # Create a Binance client
        binance = ccxt.binance({
            'apiKey': 'zzzz',
            'secret': 'zzzz',
            'enableRateLimit': True,
        })

        # Get the list of cryptocurrencies
        cryptocurrencies = ['BTC/USDT', 'ETH/USDT', 'XRP/USDT']

        # Get the Discord text channel named "crypto-test"
        channel = discord.utils.get(message.guild.channels, name='crypto-test')

        while True:
            # Get the current prices of all cryptocurrencies
            tickers = binance.fetch_tickers()

            # Get the prices of the specified cryptocurrencies
            prices = get_prices(cryptocurrencies, tickers)

            # Post the prices to the Discord text channel
            for cryptocurrency, price in prices.items():
                await channel.send(f'{cryptocurrency}: {price}')

            # Wait for 5 seconds before updating the prices again
            time.sleep(5)

client.run('DISCORD_BOT_TOKEN')

After the bot says that's ready, nothing happens.
I've added also prints and so on, still no info on it.

2022-12-08 14:57:25 INFO     discord.client logging in using static token
2022-12-08 14:57:27 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: zzzz).
Bot is ready!

Any ideas ?
Trying to learn python and create a small bot, but seems i still have things to learn.


问:
Google Sign In popup opens automatically in the new window. Problem with firebase authentication
I'm designing a page for login-with-google. But on going to sign in page, login pop opens automatically without clicking the sign-in button.On selecting any account for logging-in nothing response returned in the console. At the same time button for sign-in is not working.
This is my firebase utils file

```<code>// Importing the needed functions from the SDKs
import { initializeApp } from "firebase/app";
import { getAuth, signInWithRedirect, signInWithPopup, GoogleAuthProvider } from "firebase/auth";

// Firebase configuration
const firebaseConfig = {
  apiKey: "AIzaSyDS7nrbzh06EQDNtgwS2_xK9D4s5uuNQ7c",
  authDomain: "clothing-app-8d72c.firebaseapp.com",
  projectId: "clothing-app-8d72c",
  storageBucket: "clothing-app-8d72c.appspot.com",
  messagingSenderId: "779172384069",
  appId: "1:779172384069:web:ecfb27e17d43257c01c22c",
};

// Initialize Firebase
const fireBaseApp = initializeApp(firebaseConfig);

const provider = new GoogleAuthProvider();
provider.setCustomParameters({
  prompt:'select_account'
});
export const auth = getAuth();
export const signInWithGooglePopup = signInWithPopup(auth, provider);
</code>```

And here is my signin page code

```<code>import { signInWithGooglePopup } from "../../utils/firebase/firebase.utils";

const SignIn = () => {
  const logGoogleUser = async () => {
    const response = await signInWithGooglePopup();
    console.log(response);
  };
  return (
    <div>
      <h1>Sign In Page</h1>
      <button onClick={logGoogleUser}>Sign In With Google Popup</button>
    </div>
  );
};

export default SignIn;
</code>```

When I opens my sign-in page the popup opens automatically without clicking the button. After selecting the account no user data got printed in the console.
Where I made the mistake?

Body:
I'm designing a page for login-with-google. But on going to sign in page, login pop opens automatically without clicking the sign-in button.On selecting any account for logging-in nothing response returned in the console. At the same time button for sign-in is not working.
This is my firebase utils file

// Importing the needed functions from the SDKs
import { initializeApp } from "firebase/app";
import { getAuth, signInWithRedirect, signInWithPopup, GoogleAuthProvider } from "firebase/auth";

// Firebase configuration
const firebaseConfig = {
  apiKey: "AIzaSyDS7nrbzh06EQDNtgwS2_xK9D4s5uuNQ7c",
  authDomain: "clothing-app-8d72c.firebaseapp.com",
  projectId: "clothing-app-8d72c",
  storageBucket: "clothing-app-8d72c.appspot.com",
  messagingSenderId: "779172384069",
  appId: "1:779172384069:web:ecfb27e17d43257c01c22c",
};

// Initialize Firebase
const fireBaseApp = initializeApp(firebaseConfig);

const provider = new GoogleAuthProvider();
provider.setCustomParameters({
  prompt:'select_account'
});
export const auth = getAuth();
export const signInWithGooglePopup = signInWithPopup(auth, provider);

And here is my signin page code

import { signInWithGooglePopup } from "../../utils/firebase/firebase.utils";

const SignIn = () => {
  const logGoogleUser = async () => {
    const response = await signInWithGooglePopup();
    console.log(response);
  };
  return (

Sign In Page

      <button onClick={logGoogleUser}>Sign In With Google Popup</button>

  );
};

export default SignIn;

When I opens my sign-in page the popup opens automatically without clicking the button. After selecting the account no user data got printed in the console.
Where I made the mistake?


问:
Failed to minify the bundle. Error: static/js/2.2c2ccbd8.chunk.js from Terser
When I am trying to deploy my react app on AWS Amplify I am getting below error. We are using Amplify for last 2 years.

It was working fine till last week but now its build is failing.
I am using NODE_OPTIONS=--max_old_space_size=4096 in build command.
This project is quite big.

With code splitting biggest chunk size is 2.2 MB but number of chunk is around 100.(Is it right to have so many chunks?)

Without Lazy loading biggest chunks size is around 4.8 MB(Refer below).

Using Node Version: 12.19.0 & "react: ^16.13.1"

First I splitted the code based on route then deployed, Initially 6-7 deployment was successfull then it started failing. Then I tried many solutions from this github issue, but none of them worked then I remove the code split logic and deployed again but it was giving the same error.

Temporarily it is working when I set GENERATE_SOURCEMAP=false in .env file. But I think this is not a permanent solutions. Above solutions is only disabling the source-map.


问:
How to capitalize the common letters of two words?
I'm trying to capitalize the common letters of two words. Does anyone know why my code doesn't work?

It says:

```<code>Main.java:22: error: cannot find symbol
        char character = words.charAt(i);
                              ^
  symbol:   method charAt(int)
  location: variable words of type String[]
</code>```

The code is:

    int word2;
    int space_count = 0;

    //get input
    System.out.println ("Input two words: ");
    int word = sameletters.nextInt();

    String words[] = new String[word];

    //find the begining of the second word
    for(int i = 0, n = words.length; i<n; i++)
    {
        char character = words.charAt(i);
        if(Character.isWhitespace(character))
        {
            word2 = i + 1;
            space_count++;
        }
    }

    //validate the input.
    for(int i = 0, n = words.length; i<n; i++)
    {
    if(space_count != 1)
    {
        System.out.println ("MUST CONTAIN 2 WORDS\n");
        break;
    }
    }

    //loop for the first word
    for (int i = 0, n = word2 - 1; i < n; i++)
    {
        //loop for the second word
        for (int j = word2, x = words.length; j < x; j++)
        {
            //compare the letters
            if(words[i] == words[j])
            {
                words[i] = words[i].toUpperCase();
                words[j] = words[j].toUpperCase();
            }
        }
    }

    //print output
    System.out.println ("\n" + words);
    sameletters.close();
}
}
```

Body:
I'm trying to capitalize the common letters of two words. Does anyone know why my code doesn't work?

It says:

Main.java:22: error: cannot find symbol
        char character = words.charAt(i);
                              ^
  symbol:   method charAt(int)
  location: variable words of type String[]

The code is:

    int word2;
    int space_count = 0;

    //get input
    System.out.println ("Input two words: ");
    int word = sameletters.nextInt();

    String words[] = new String[word];

    //find the begining of the second word
    for(int i = 0, n = words.length; i<n; i++)
    {
        char character = words.charAt(i);
        if(Character.isWhitespace(character))
        {
            word2 = i + 1;
            space_count++;
        }
    }

    //validate the input.
    for(int i = 0, n = words.length; i<n; i++)
    {
    if(space_count != 1)
    {
        System.out.println ("MUST CONTAIN 2 WORDS\n");
        break;
    }
    }

    //loop for the first word
    for (int i = 0, n = word2 - 1; i < n; i++)
    {
        //loop for the second word
        for (int j = word2, x = words.length; j < x; j++)
        {
            //compare the letters
            if(words[i] == words[j])
            {
                words[i] = words[i].toUpperCase();
                words[j] = words[j].toUpperCase();
            }
        }
    }

    //print output
    System.out.println ("\n" + words);
    sameletters.close();
}
}


问:
Sidekiq set-up from localhost to deployment
Context: First time usage of ActiveJob via Sidekiq and Redis.

Situation:  Sidekiq and redis are installed and running (route /sidekiq does generate the control panel) and is polling.

Issue(s?): Installation on remote server and enabling rather opaque... which may explain whay a  default  defined job is not executing although the server is inactive.

Maybe the sequence of going through Rails, then Sidekiq, then redis documentation was mistaken.

Uncertainty #1:  However, I finally picked up that redis-server has to be launched.  But what is not clear is how this can be part of the deployment process and a server start-up process to ensure this is running without manual input?

Uncertainty #2: Documentation indicates that sidekiq should be started via

```<code>bundle exec sidekiq -q critical -q high -q default -q low
</code>```

again, what is not clear is how this can be part of the deployment process and a server start-up process to ensure this is running without manual input?

Uncertainty #3: if one of the above two is done improperly it may explain the following behaviour.

After starting sidekiq with the above command (this is assuming 4 levels of priority are needed.  In the present context they are not; but I wanted to test and observe behaviour) and through an action activating a job

```<code>GenerateCodeJob.perform_later(item, shop)
</code>```

=> it is found in Sidekiq's queues, under the Queue default and sits there for yonks.

My understanding is that jobs are performed based on server resource availability.  But that is clearly not the case.

So what are the priorities and what type of timings are involved?
Or could the set-up be mistaken?

Body:
Context: First time usage of ActiveJob via Sidekiq and Redis.

Situation:  Sidekiq and redis are installed and running (route /sidekiq does generate the control panel) and is polling.

Issue(s?): Installation on remote server and enabling rather opaque... which may explain whay a  default  defined job is not executing although the server is inactive.

Maybe the sequence of going through Rails, then Sidekiq, then redis documentation was mistaken.

Uncertainty #1:  However, I finally picked up that redis-server has to be launched.  But what is not clear is how this can be part of the deployment process and a server start-up process to ensure this is running without manual input?

Uncertainty #2: Documentation indicates that sidekiq should be started via

bundle exec sidekiq -q critical -q high -q default -q low

again, what is not clear is how this can be part of the deployment process and a server start-up process to ensure this is running without manual input?

Uncertainty #3: if one of the above two is done improperly it may explain the following behaviour.

After starting sidekiq with the above command (this is assuming 4 levels of priority are needed.  In the present context they are not; but I wanted to test and observe behaviour) and through an action activating a job

GenerateCodeJob.perform_later(item, shop)

=> it is found in Sidekiq's queues, under the Queue default and sits there for yonks.

My understanding is that jobs are performed based on server resource availability.  But that is clearly not the case.

So what are the priorities and what type of timings are involved?
Or could the set-up be mistaken?


问:
'Check that you have enabled metadata publishing at the specified address' error
I am developing a project with .net core. I am getting the following error when trying to integrate the web service.

enter image description here

I can access the web service link from the browser. It returns XML.


问:
How do I filter a data set with a reactive function in Shiny?
I'm trying to filter my data set based on one/multiple inputs for a variable. My data set exists of concentration, time and #study data. Normally, if I would want to filter my data set based on study number(s), I would enter this code:

```<code>df %>% filter(study == "1.3" & study == "2.1")
</code>```

Anyways, I want to create a Shiny app and allow users to visualize data based on a filter. For example, I'd want them to only visualize concentration/time data for a certain study (Toxicity/Single dose/Repeat dose). I'm quite new to Shiny, so I read some information on the function reactive(), but I don't think I understand it good enough yet. But, I want to show you guys my complete code.

```<code>df <- MadeUpDataSet
df <- df %>% filter(DV > 0.0533)
#df$DV <- as.numeric(as.character(df$DV))
#df$TIME <- as.numeric(as.character(df$TIME))

# Define UI for application
ui <- fluidPage(

    tabsetPanel(tabPanel("Tab 1",

                         titlePanel("Shiny App: Concentration vs Time Graphs"),

                         sidebarLayout(
                             mainPanel("Concentration vs Time graphs",
                                       plotOutput(outputId = "plot")
                             ),
                             sidebarPanel(helpText("This app is developed to visualize pharmacokinetic data of different antibodies..."),
                                          selectInput(
                                              inputId = "study",
                                              label = "Include study:",
                                              choices = c("GLP Toxicity" = "ME1044-011", "Dose Range Finding", "Single Dose", "Repeat Dose"),
                                              selected = "ME1044-011",
                                              multiple = T
                                          ),
                                          selectInput(
                                              inputId = "x",
                                              label = "X-axis:",
                                              choices = c("Time" = "TIME", "TLD"),
                                              selected = "Time"
                                          ),
                                          selectInput(
                                              inputId = 'column',
                                              label = "Columns for:",
                                              choices = c("Dose mg/kg" = "DOSEMGKG", "Species" = "SPECIES", "Antibody" = "ABXID", "Subspecies" = "SUBSPECIES", "Age" = "AGE", "Animal ID" = "ANIMALID"),
                                              selected = "DOSEMGKG"
                                          ),
                                          selectInput(
                                              inputId = 'row',
                                              label = "Rows for:",
                                              choices = c("Dose mg/kg" = "DOSEMGKG", "Species" = "SPECIES", "Antibody" = "ABXID", "Subspecies" = "SUBSPECIES", "Age" = "AGE",  "Animal ID" = "ANIMALID"),
                                              selected = "ABXID"
                                          ),
                                          selectInput(
                                              inputId = "group",
                                              label = "Group by:",
                                              choices = c("Dose mg/kg" = "DOSEMGKG", "Species" = "SPECIES", "Antibody" = "ABXID", "Subspecies" = "SUBSPECIES", "Age" = "AGE",  "Animal ID" = "ANIMALID"),
                                              selected = "ANIMALID"
                                          ),
                                          sliderInput(
                                              inputId = 'trange',
                                              label = "Time range:",
                                              min = 0,
                                              max = 1704,
                                              value = c(0, 1704 )
                                          )
                             ))

    )),

    tabsetPanel(tabPanel("Tab 2",

                         titlePanel("Tab 2"),

                         sidebarLayout(
                             mainPanel("Plot #2", plotOutput(outputId = "plot2")
                             ),
                             sidebarPanel(helpText("Whatever text..."),
                                          selectInput(
                                              inputId = 't',
                                              label = "Example",
                                              choices = c("#1", "#2", "#3"),
                                              selected = "#1"
                                          )
                             )
                         )))
)

# Define server

server <- function(input, output, session){

    **df <- reactive({df %>% filter("STUDYID" == input$study)})**

    output$plot <- renderPlot({
        ggplot(data = df, aes_string(x = input$x, y = "DV", col = input$group)) + xlab("Time") + ylab("Concentration (ug/mL)") +
            geom_point() + facet_grid(get(input$row) ~ get(input$column)) + scale_x_continuous(limits = input$trange) + theme_bw() })

}

shinyApp(ui = ui, server = server)
</code>```

Notes: I'm still working on the second tab, so that can be forgotten. Anyways, I hope that the code is understandable. So I tried to include the code between the ** **. But then I receive this error:

Warning: Error in :   You're passing a function as global data.
Have you misspelled the data argument in ggplot()

I hope you guys get my question. I'm pretty sure there's a simple answer to this question, but I'm not so familiar with Shiny etc.

Body:
I'm trying to filter my data set based on one/multiple inputs for a variable. My data set exists of concentration, time and #study data. Normally, if I would want to filter my data set based on study number(s), I would enter this code:

df %>% filter(study == "1.3" & study == "2.1")

Anyways, I want to create a Shiny app and allow users to visualize data based on a filter. For example, I'd want them to only visualize concentration/time data for a certain study (Toxicity/Single dose/Repeat dose). I'm quite new to Shiny, so I read some information on the function reactive(), but I don't think I understand it good enough yet. But, I want to show you guys my complete code.

df <- MadeUpDataSet
df <- df %>% filter(DV > 0.0533)
#df$DV <- as.numeric(as.character(df$DV))
#df$TIME <- as.numeric(as.character(df$TIME))

# Define UI for application
ui <- fluidPage(

    tabsetPanel(tabPanel("Tab 1",

                         titlePanel("Shiny App: Concentration vs Time Graphs"),

                         sidebarLayout(
                             mainPanel("Concentration vs Time graphs",
                                       plotOutput(outputId = "plot")
                             ),
                             sidebarPanel(helpText("This app is developed to visualize pharmacokinetic data of different antibodies..."),
                                          selectInput(
                                              inputId = "study",
                                              label = "Include study:",
                                              choices = c("GLP Toxicity" = "ME1044-011", "Dose Range Finding", "Single Dose", "Repeat Dose"),
                                              selected = "ME1044-011",
                                              multiple = T
                                          ),
                                          selectInput(
                                              inputId = "x",
                                              label = "X-axis:",
                                              choices = c("Time" = "TIME", "TLD"),
                                              selected = "Time"
                                          ),
                                          selectInput(
                                              inputId = 'column',
                                              label = "Columns for:",
                                              choices = c("Dose mg/kg" = "DOSEMGKG", "Species" = "SPECIES", "Antibody" = "ABXID", "Subspecies" = "SUBSPECIES", "Age" = "AGE", "Animal ID" = "ANIMALID"),
                                              selected = "DOSEMGKG"
                                          ),
                                          selectInput(
                                              inputId = 'row',
                                              label = "Rows for:",
                                              choices = c("Dose mg/kg" = "DOSEMGKG", "Species" = "SPECIES", "Antibody" = "ABXID", "Subspecies" = "SUBSPECIES", "Age" = "AGE",  "Animal ID" = "ANIMALID"),
                                              selected = "ABXID"
                                          ),
                                          selectInput(
                                              inputId = "group",
                                              label = "Group by:",
                                              choices = c("Dose mg/kg" = "DOSEMGKG", "Species" = "SPECIES", "Antibody" = "ABXID", "Subspecies" = "SUBSPECIES", "Age" = "AGE",  "Animal ID" = "ANIMALID"),
                                              selected = "ANIMALID"
                                          ),
                                          sliderInput(
                                              inputId = 'trange',
                                              label = "Time range:",
                                              min = 0,
                                              max = 1704,
                                              value = c(0, 1704 )
                                          )
                             ))

    )),

    tabsetPanel(tabPanel("Tab 2",

                         titlePanel("Tab 2"),

                         sidebarLayout(
                             mainPanel("Plot #2", plotOutput(outputId = "plot2")
                             ),
                             sidebarPanel(helpText("Whatever text..."),
                                          selectInput(
                                              inputId = 't',
                                              label = "Example",
                                              choices = c("#1", "#2", "#3"),
                                              selected = "#1"
                                          )
                             )
                         )))
)

# Define server

server <- function(input, output, session){

    **df <- reactive({df %>% filter("STUDYID" == input$study)})**

    output$plot <- renderPlot({
        ggplot(data = df, aes_string(x = input$x, y = "DV", col = input$group)) + xlab("Time") + ylab("Concentration (ug/mL)") +
            geom_point() + facet_grid(get(input$row) ~ get(input$column)) + scale_x_continuous(limits = input$trange) + theme_bw() })

}

shinyApp(ui = ui, server = server)

Notes: I'm still working on the second tab, so that can be forgotten. Anyways, I hope that the code is understandable. So I tried to include the code between the ** **. But then I receive this error:

Warning: Error in :   You're passing a function as global data.
Have you misspelled the data argument in ggplot()

I hope you guys get my question. I'm pretty sure there's a simple answer to this question, but I'm not so familiar with Shiny etc.


问:
27 ftp server error using ftp appache client in passive mode
Trying to get list of files from FTP in passive mode using FTP appache client

here is connect

```<code>public void connect() throws IOException {
    ftp.connect(host, port);
    if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
        ftp.disconnect();
        throw new IOException("Exception in connecting to FTP Server");
    }
    ftp.enterLocalPassiveMode();
    if (!ftp.login(login, password)) {
        ftp.disconnect();
        throw new IOException("Failed to login ftp server");
    }
}
</code>```

here is method to get list of files

```<code> public List<String> getPaths(String path, String date)  {
        try {
         val listFiles = ftp.listFiles(path);//1
         val listNames = ftp.listNames(path);//2
    return null;

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
</code>```

and next i call getPaths method in a loop to get file or file names from 1000 + folders

and if i use ftp.listFiles(path) i get exception(one or two times from 1000 + calls)

org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
Server Reply: 27 Entering Passive Mode (10,141,166,68,126,88).

if i use ftp.listNames(path) i didnt get this exception

if i use default Ftp mode (means i remove this ftp.enterLocalPassiveMode();)
i didnt get exceptions

but here is problem i cant use active ftp mode and i still need to call ftp.listFiles(path)

what is the problem of this exception and how to fix it

here is logs

```<code>PASV
227 Entering Passive Mode (95,167,245,94,129,168)
LIST /out/published/Jamalo-Nenetckii_AO/purchaseNoticeEP/daily
150 Here comes the directory listing.
226 Directory send OK.
PASV
227 Entering Passive Mode (95,167,245,94,129,0)
LIST /out/published/Jamalo-Nenetckii_AO/purchaseNoticeIS/daily
150 Here comes the directory listing.
226 Directory send OK.
PASV
org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
Server Reply: 27 Entering Passive Mode (10,141,166,68,118,198).
</code>```

webshark trafic capture

this one send to clien wrong ip address

Body:
Trying to get list of files from FTP in passive mode using FTP appache client

here is connect

public void connect() throws IOException {
    ftp.connect(host, port);
    if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
        ftp.disconnect();
        throw new IOException("Exception in connecting to FTP Server");
    }
    ftp.enterLocalPassiveMode();
    if (!ftp.login(login, password)) {
        ftp.disconnect();
        throw new IOException("Failed to login ftp server");
    }
}

here is method to get list of files

 public List<String> getPaths(String path, String date)  {
        try {
         val listFiles = ftp.listFiles(path);//1
         val listNames = ftp.listNames(path);//2
    return null;

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

and next i call getPaths method in a loop to get file or file names from 1000 + folders

and if i use ftp.listFiles(path) i get exception(one or two times from 1000 + calls)

org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
Server Reply: 27 Entering Passive Mode (10,141,166,68,126,88).

if i use ftp.listNames(path) i didnt get this exception

if i use default Ftp mode (means i remove this ftp.enterLocalPassiveMode();)
i didnt get exceptions

but here is problem i cant use active ftp mode and i still need to call ftp.listFiles(path)

what is the problem of this exception and how to fix it

here is logs

PASV
227 Entering Passive Mode (95,167,245,94,129,168)
LIST /out/published/Jamalo-Nenetckii_AO/purchaseNoticeEP/daily
150 Here comes the directory listing.
226 Directory send OK.
PASV
227 Entering Passive Mode (95,167,245,94,129,0)
LIST /out/published/Jamalo-Nenetckii_AO/purchaseNoticeIS/daily
150 Here comes the directory listing.
226 Directory send OK.
PASV
org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
Server Reply: 27 Entering Passive Mode (10,141,166,68,118,198).

webshark trafic capture

this one send to clien wrong ip address


问:
How to set the color of inkeditor in pdf.js 3.0 in javascript
With pdf.js 3.0 ink- and freetext-editor were introduced. How to set color, size and so on in javascript?

I tried to set the value of the html-input-Element, but without success.


问:
How to fix security errors for C# (Insecure Data Storage)
I am getting security issue reported for the below lines in File A and File B. In this file, we read the username and password. This is not getting logged in the log file.

Also, is it possible to catch such issues during the development phase, rather than getting these in the security testing phase which happens later? Any guidelines on how to configure this in visual studio 2022 and sonarqube to catch such issues early?

```<code>string serviceUserName = Environment.GetEnvironmentVariable("Service_UserName");
string servicePassword = Environment.GetEnvironmentVariable("Service_Password");
</code>```
```<code>log.LogInformation($"Status of Blob trigger function with blob\n Name:{fileName} is: {response.StatusCode}");
</code>```

Categories
OWASP Mobile Top 10 2016: M2-Insecure Data Storage

Body:
I am getting security issue reported for the below lines in File A and File B. In this file, we read the username and password. This is not getting logged in the log file.

Also, is it possible to catch such issues during the development phase, rather than getting these in the security testing phase which happens later? Any guidelines on how to configure this in visual studio 2022 and sonarqube to catch such issues early?

string serviceUserName = Environment.GetEnvironmentVariable("Service_UserName");
string servicePassword = Environment.GetEnvironmentVariable("Service_Password");

log.LogInformation($"Status of Blob trigger function with blob\n Name:{fileName} is: {response.StatusCode}");

Categories
OWASP Mobile Top 10 2016: M2-Insecure Data Storage


问:
`sync_partition_metadata` in presto as a result returning query
Is there a way to make this query work?

```<code>SELECT "result" AS "result"
FROM (CALL system.sync_partition_metadata('schema', 'table', 'ADD')) AS "virtual_table"
LIMIT 1000;
</code>```

this is the error I get:

presto error: line 3:18: mismatched input '.'. Expecting: '(', ')',
',', 'AS', 'CROSS', 'EXCEPT', 'FETCH', 'FULL', 'GROUP', 'HAVING',
'INNER', 'INTERSECT', 'JOIN', 'LEFT', 'LIMIT', 'MATCH_RECOGNIZE',
'NATURAL', 'OFFSET', 'ORDER', 'RIGHT', 'TABLESAMPLE', 'UNION',
'WHERE', 'WINDOW', ,

Body:
Is there a way to make this query work?

SELECT "result" AS "result"
FROM (CALL system.sync_partition_metadata('schema', 'table', 'ADD')) AS "virtual_table"
LIMIT 1000;

this is the error I get:

presto error: line 3:18: mismatched input '.'. Expecting: '(', ')',
',', 'AS', 'CROSS', 'EXCEPT', 'FETCH', 'FULL', 'GROUP', 'HAVING',
'INNER', 'INTERSECT', 'JOIN', 'LEFT', 'LIMIT', 'MATCH_RECOGNIZE',
'NATURAL', 'OFFSET', 'ORDER', 'RIGHT', 'TABLESAMPLE', 'UNION',
'WHERE', 'WINDOW', ,


问:
How to track url changes on python?
How to track url change or button click through python program? I have a code that opens a tab and opens full screen mode by pressing F11, there is a button on the site, when clicked, it redirects to another url. When you change the url or when you click the button, you need to change the full screen mode again. I need a funktion, that can track url on browser opened tab.

There's the code. I can't find any information of tracking changes of url on python.

`

```<code>import webbowser as web
import keyboard as kb

web.open(https://url)
kb.press_and_release('F11')

trueUrl = 'https://url'

while url != trueUrl:
    url = #url that corresponds to the open tab
kb.press_and_release('F11')
</code>```

`

Title: How to track url changes on python?

Body:
How to track url change or button click through python program? I have a code that opens a tab and opens full screen mode by pressing F11, there is a button on the site, when clicked, it redirects to another url. When you change the url or when you click the button, you need to change the full screen mode again. I need a funktion, that can track url on browser opened tab.

There's the code. I can't find any information of tracking changes of url on python.

`

import webbowser as web
import keyboard as kb

web.open(https://url)
kb.press_and_release('F11')

trueUrl = 'https://url'

while url != trueUrl:
    url = #url that corresponds to the open tab
kb.press_and_release('F11')

`


问:
When and based on which specification do screen readers announce a group name
The ARIA standard offers the group and the region roles to group contents or user interface objects.

Both require a name provided by author, and screen readers seem to announce when such a grouping is entered or left, announcing the grouping‘s name on enter. This also applies for other roles such as list or dialog.

I tried to pin that behaviour to some abstract role, but couldn’t identify a commonality between these roles in the role hierarchy.

I’m under the impression that TalkBack, Orca, NVDA and JAWS all have this behaviour, which is really practical.

But based on which standard did they implement this, and what is the actual support status? Can we rely on this for interface design?

ChromeVox, who is gaining in popularity, did not show this behaviour when I tested, but then again it has other big shortcomings as of now.

<hgroup>

Grouping examples

Entering/leaving each of these grouping might get announced by the screen reader, along with the grouping’s accessible name

</hgroup>

Start here

  <button>Button inside group</button>

  <input type="radio" name="radio1">Video
  <input type="radio" name="radio1">killed
  <input type="radio" name="radio1">the
  <input type="radio" name="radio1">radio
  <input type="radio" name="radio1">star

<button>Button in list</button>

and

some

items

  <button>Button in a dialog</button>

```


问:
React Native Application can't build on MacOS
I have an Imac with M1, 16G, and i'm trying to build a react native project using Xcode.

Here are all the version i'm using:

I have this error message when I enter in my react-native application folder

My pod install fail with this error message

And the Build automaticly fail when i start the project.

I try to follow th step of the react native documentation:
https://reactnative.dev/docs/environment-setup

 npm uninstall -g react-native-cli @react-native-community/cli

I don't know why but when I tried this it just say "already up to date" and do nothing.

The only thing i find to generate a working project is to set the react-native version to 0.68.2 but my project is working on 0.70.1

If someone has any solution, I'm open.


问:
Twilio: is it possible to keep the same number while forwarding a call to twilio
I was wondering if such a flow is possible when A calls B:

```<code>          /-B phone rings   /-B answers => Twilio connects A with B
A calls B                 IF
          \-A hear a music  \-B doesn't answer => Twilio keep handling the call
</code>```

Where the main challenge here being that the phone number A calls in the first place should be B phone number and not a twilio number

To take a real world example, I am trying to propose a voicemail service to a customer but I don't want him to change his phone number nor to forward his actual phone number to twilio that will forward again to another of my customer's phone number (that's actually the only solution I managed to get working for now)

Is that possible ?

Body:
I was wondering if such a flow is possible when A calls B:

          /-B phone rings   /-B answers => Twilio connects A with B
A calls B                 IF
          \-A hear a music  \-B doesn't answer => Twilio keep handling the call

Where the main challenge here being that the phone number A calls in the first place should be B phone number and not a twilio number

To take a real world example, I am trying to propose a voicemail service to a customer but I don't want him to change his phone number nor to forward his actual phone number to twilio that will forward again to another of my customer's phone number (that's actually the only solution I managed to get working for now)

Is that possible ?


问:
Gitlab CI runner service does not handle multiple jobs in parallel
I have registered two Gitlab runners in my Gitlab runner service instance which I am running in a Docker container. After adding concurrent = 2 to config.toml and restarting the service, multiple jobs are still processed one after the other. According to the log in step 5, the service doesn't check for new jobs anymore, if one job is being processed by a runner. Not sure what I am doing wrong. Thanks for your help in advance.

1. Start Gitlab runner service (15.6.1) with

```<code>docker run -d --name gitlab-runner --restart always \
     -v /srv/gitlab-runner/config:/etc/gitlab-runner \
     -v /var/run/docker.sock:/var/run/docker.sock \
     gitlab/gitlab-runner:latest
</code>```

2. Register two runners with

```<code>docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
  --output-limit 32768 \
  --non-interactive \
  --executor "docker" \
  --docker-image docker:stable \
  --url "https://code.xyz.com/" \
  --registration-token "REGISTRATION_TOKEN" \
  --description "docker-runner" \
  --tag-list "Bignode" \
  --run-untagged="true" \
  --locked="false" \
  --access-level="not_protected" \
  --docker-volumes "/certs/client" \
  --docker-volumes /var/run/docker.sock:/var/run/docker.sock \
  --docker-privileged
</code>```

3. Adding concurrent = 2 to /etc/gitlab-runner/config.toml and restart service with docker restart gitlab-runner.

Content of /etc/gitlab-runner/config.toml:

```<code>concurrent = 2
check_interval = 0

[session_server]
  session_timeout = 1800
</code>```

4. Verifying with docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner verify

```<code>Runtime platform                                    arch=amd64 os=linux pid=7 revision=133d7e76 version=15.6.1
Running in system-mode.

Verifying runner... is alive                        runner=ARFtksFa
Verifying runner... is alive                        runner=82d_Zf3-

</code>```

5. Submitting two jobs and monitoring with docker logs gitlab-runner

```<code>Checking for jobs...nothing                         runner=ARFtksFa
Checking for jobs...nothing                         runner=82d_Zf3-
Checking for jobs...nothing                         runner=ARFtksFa
Checking for jobs...nothing                         runner=82d_Zf3-
Checking for jobs... received                       job=15913966 repo_url=https://code.xyz.com/api.git runner=ARFtksFa
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-531 job-status=running runner=ARFtksFa sent-log=0-530 status=202 Accepted update-interval=1m0s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-4766 job-status=running runner=ARFtksFa sent-log=531-4765 status=202 Accepted update-interval=3s
Updating job...                                     bytesize=4766 checksum=crc32:0dde253a job=15913966 runner=ARFtksFa
Submitting job to coordinator...ok                  bytesize=4766 checksum=crc32:0dde253a code=200 job=15913966 job-status= runner=ARFtksFa update-interval=0s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-10698 job-status=running runner=ARFtksFa sent-log=4766-10697 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-21256 job-status=running runner=ARFtksFa sent-log=10698-21255 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-25321 job-status=running runner=ARFtksFa sent-log=21256-25320 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-31869 job-status=running runner=ARFtksFa sent-log=25321-31868 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-32971 job-status=running runner=ARFtksFa sent-log=31869-32970 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-39682 job-status=running runner=ARFtksFa sent-log=32971-39681 status=202 Accepted update-interval=3s
</code>```

Body:
I have registered two Gitlab runners in my Gitlab runner service instance which I am running in a Docker container. After adding concurrent = 2 to config.toml and restarting the service, multiple jobs are still processed one after the other. According to the log in step 5, the service doesn't check for new jobs anymore, if one job is being processed by a runner. Not sure what I am doing wrong. Thanks for your help in advance.

1. Start Gitlab runner service (15.6.1) with

docker run -d --name gitlab-runner --restart always \
     -v /srv/gitlab-runner/config:/etc/gitlab-runner \
     -v /var/run/docker.sock:/var/run/docker.sock \
     gitlab/gitlab-runner:latest

2. Register two runners with

docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
  --output-limit 32768 \
  --non-interactive \
  --executor "docker" \
  --docker-image docker:stable \
  --url "https://code.xyz.com/" \
  --registration-token "REGISTRATION_TOKEN" \
  --description "docker-runner" \
  --tag-list "Bignode" \
  --run-untagged="true" \
  --locked="false" \
  --access-level="not_protected" \
  --docker-volumes "/certs/client" \
  --docker-volumes /var/run/docker.sock:/var/run/docker.sock \
  --docker-privileged

3. Adding concurrent = 2 to /etc/gitlab-runner/config.toml and restart service with docker restart gitlab-runner.

Content of /etc/gitlab-runner/config.toml:

concurrent = 2
check_interval = 0

[session_server]
  session_timeout = 1800

4. Verifying with docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner verify

Runtime platform                                    arch=amd64 os=linux pid=7 revision=133d7e76 version=15.6.1
Running in system-mode.

Verifying runner... is alive                        runner=ARFtksFa
Verifying runner... is alive                        runner=82d_Zf3-

5. Submitting two jobs and monitoring with docker logs gitlab-runner

Checking for jobs...nothing                         runner=ARFtksFa
Checking for jobs...nothing                         runner=82d_Zf3-
Checking for jobs...nothing                         runner=ARFtksFa
Checking for jobs...nothing                         runner=82d_Zf3-
Checking for jobs... received                       job=15913966 repo_url=https://code.xyz.com/api.git runner=ARFtksFa
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-531 job-status=running runner=ARFtksFa sent-log=0-530 status=202 Accepted update-interval=1m0s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-4766 job-status=running runner=ARFtksFa sent-log=531-4765 status=202 Accepted update-interval=3s
Updating job...                                     bytesize=4766 checksum=crc32:0dde253a job=15913966 runner=ARFtksFa
Submitting job to coordinator...ok                  bytesize=4766 checksum=crc32:0dde253a code=200 job=15913966 job-status= runner=ARFtksFa update-interval=0s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-10698 job-status=running runner=ARFtksFa sent-log=4766-10697 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-21256 job-status=running runner=ARFtksFa sent-log=10698-21255 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-25321 job-status=running runner=ARFtksFa sent-log=21256-25320 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-31869 job-status=running runner=ARFtksFa sent-log=25321-31868 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-32971 job-status=running runner=ARFtksFa sent-log=31869-32970 status=202 Accepted update-interval=3s
Appending trace to coordinator...ok                 code=202 job=15913966 job-log=0-39682 job-status=running runner=ARFtksFa sent-log=32971-39681 status=202 Accepted update-interval=3s


问:
Hyper-v manager errorcode 0x80090342
Hyper-v manager can't connect to server and gives this error, how can I fix it?
Thanks

What is the OS ? - win10
Are you connecting locally - remote do you connect by FQDN
Do you use an account -  right permissions

Title: Hyper-v manager errorcode 0x80090342


问:
Filenet Bulk Actions Script via API
I know there is a great way to access the bulk action on acce.
Access the object store search in the administration console
On the SQL view tab, enter an appropriate query.
On the Bulk Actions tab, select Enable.
In the Script section, select Run script.
Enter your JavaScript code into the Script field. For more information, see an example below.
Click Run. The administration console runs the query and the JavaScript action.

What I was wondering is there a way to Access this same thing via the api?
AKA via api feed it a query and then feed it a script and watch it run

Title: Filenet Bulk Actions Script via API


问:
Column showing NaN after row filtering in a pandas dataframe
Values of the last column is discarded after row filtering based on values. The issue is not with the pd.merge operation as because after merging the values are still intact. Only after filtering the values are being lost.

I merged two dataframes as in the following code.

```<code>merged = pd.merge(A,B,left_on=['Company Code','Document Number','Fiscal Year'], right_on = ['Company Code','Document Number','Fiscal Year',],how="outer")
</code>```

The merge was successful and the intended columns and all were present in the "merged" dataframe.
But after i filtered the merged dataframe as below,

```<code>filtered=merged[merged['Offsetting Acct Type'] == "K"]
</code>```

Just after this operation, The last column "Parked By" all get NaN values. The original column had some missing values but still after the merge it was accessible. Only after I filter the values are being discarded. Any help would be appreciated!

Body:
Values of the last column is discarded after row filtering based on values. The issue is not with the pd.merge operation as because after merging the values are still intact. Only after filtering the values are being lost.

I merged two dataframes as in the following code.

merged = pd.merge(A,B,left_on=['Company Code','Document Number','Fiscal Year'], right_on = ['Company Code','Document Number','Fiscal Year',],how="outer")

The merge was successful and the intended columns and all were present in the "merged" dataframe.
But after i filtered the merged dataframe as below,

filtered=merged[merged['Offsetting Acct Type'] == "K"]

Just after this operation, The last column "Parked By" all get NaN values. The original column had some missing values but still after the merge it was accessible. Only after I filter the values are being discarded. Any help would be appreciated!


问:
Kubernetes job for creating couchbase collections dynamically
I am looking for approach how to create collections in existing scope of couchbase dynamically. Requirement is it should be periodic and should NOT be done via spring application  but via some external kubernetes job. Any such reference implementation would be available for kubernetes job which will create collections dynamically in couchbase. Frequency of this job will be less may be every few months.</p>


问:
Injecting a Groovy variable into Email Body
```<code>String responseBody =  "<table style="width:30%">
 <TR>
 <TD>Failed A Count</TD>
 <TD>2869</TD>
 </TR>
 <TR>
 <TD>Failed B Count</TD>
 <TD>9948</TD>
 </TR>
 <TR>
 <TD>Failed C Count</TD>
 <TD>3456</TD>
 </TR></table>"
String[] splitData = responseBody.split("\n");

String failedMFCount = splitData[3];
String actual = failedMFCount.drop(5);
Integer failedMf = failedMFCount.drop(5).reverse().drop(5).reverse().toInteger();
if (failedMf > 100) {
print("MF count is Higher")
 }
</code>```

I am trying to use the above failedMf variable to use in my Email Notification in post build action in Jenkins. Need some help on that.

I as trying to inject it in Env variables which I haven't succeeded yet. Not sure if that is the right approach.

Body:
String responseBody =  "

 Failed A Count
 2869

 Failed B Count
 9948

 Failed C Count
 3456

"
String[] splitData = responseBody.split("\n");

String failedMFCount = splitData[3];
String actual = failedMFCount.drop(5);
Integer failedMf = failedMFCount.drop(5).reverse().drop(5).reverse().toInteger();
if (failedMf > 100) {
print("MF count is Higher")
 }

I am trying to use the above failedMf variable to use in my Email Notification in post build action in Jenkins. Need some help on that.

I as trying to inject it in Env variables which I haven't succeeded yet. Not sure if that is the right approach.