问:
Puppeteer export PDF without component data
I want to use puppeteer to export a React SPA with charts that changes when user selects data in a table, it gives better quality than jspdf but I am having a hard time understanding how to adapt it to dynamic data.
My problem is that PDF export works but it prints chart component without its new data (i.e. charts that are initially loaded by the page).
Here is my fonction to export the PDF

```<code>const pdfHandler=()=>{
  Axios.post('http://localhost:8080/create-pdf', {tabEff},
  {responseType: 'arraybuffer',
  headers: {
  'Accept': 'application/pdf'
  }})
  .then((response) => {
  const blob = new Blob([response.data], {type: 'application/pdf'})
  const link = document.createElement('a')
  link.href = window.URL.createObjectURL(blob)
  link.download = 'test.pdf'
  link.click()
  })}
</code>```

And here is the associated route

```<code>async function createPDF (tabEff){
const browser = await puppeteer.launch({headless:true});
const page = await browser.newPage();
await page.setDefaultNavigationTimeout(0);
await page.goto('http://localhost:3000/', {waitUntil: 'networkidle0'});

const pdf = await page.pdf({ printBackground:true, format: 'A4',pageRanges:'1' });
await browser.close();
return pdf;
}
router.post('/create-pdf', async(req, res) => {
const pdf=await createPDF(req.body.tabEff);
res.set({ 'Content-Type': 'application/pdf', 'Content-Length': pdf.length })
res.send(pdf)
});
</code>```

I have tried to add a page.waitForNavigation({waitUntil: 'load'}) it's like my computer wants to download the PDF but nothing happens.

Is it because the fonction is asynchronous ? Does anyone knows how to export the data that is actually displayed by the page ?

Body:
I want to use puppeteer to export a React SPA with charts that changes when user selects data in a table, it gives better quality than jspdf but I am having a hard time understanding how to adapt it to dynamic data.
My problem is that PDF export works but it prints chart component without its new data (i.e. charts that are initially loaded by the page).
Here is my fonction to export the PDF

const pdfHandler=()=>{
  Axios.post('http://localhost:8080/create-pdf', {tabEff},
  {responseType: 'arraybuffer',
  headers: {
  'Accept': 'application/pdf'
  }})
  .then((response) => {
  const blob = new Blob([response.data], {type: 'application/pdf'})
  const link = document.createElement('a')
  link.href = window.URL.createObjectURL(blob)
  link.download = 'test.pdf'
  link.click()
  })}

And here is the associated route

async function createPDF (tabEff){
const browser = await puppeteer.launch({headless:true});
const page = await browser.newPage();
await page.setDefaultNavigationTimeout(0);
await page.goto('http://localhost:3000/', {waitUntil: 'networkidle0'});

const pdf = await page.pdf({ printBackground:true, format: 'A4',pageRanges:'1' });
await browser.close();
return pdf;
}
router.post('/create-pdf', async(req, res) => {
const pdf=await createPDF(req.body.tabEff);
res.set({ 'Content-Type': 'application/pdf', 'Content-Length': pdf.length })
res.send(pdf)
});

I have tried to add a page.waitForNavigation({waitUntil: 'load'}) it's like my computer wants to download the PDF but nothing happens.

Is it because the fonction is asynchronous ? Does anyone knows how to export the data that is actually displayed by the page ?


来源: stackexchange

问:
Is SHA1 certificate same for every project done in same pc?
I am building a flutter app in an online IDE called Flutlab .But in that IDE,you can't type any commands .I've heard that the SHA-1 key is unique to every developer device (like your PC) and not to every project. So I was wondering if I could just make a new Android Studio project, get the SHA-1 key and use that, in this project in Flutlab .</p>

ContentLicense: CC BY-SA 4.0


问:
Configure both logback.xml and log4j2.xml in a single sprinboot application
Hi I have a requirement to configure both logback and log4j2 in my spring-boot application.
It all started with Syslog. Initially, my application had only logback.xml configuration, and I had configured the Syslog appender. But logback does not have support to RFC5424 format. But this is supported in log4j2.

Hence I wanted to configure both which would suffice both of my requirements.

Below is my logback.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="DEV_HOME" value="/data/storage/log"></property>
<appender name="Console"
    class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>
            %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
        </Pattern>
    </layout>
</appender>

<appender name="RollingFile"
    class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/data/storage/log/cms.log</file>
    <encoder
        class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
    </encoder>

    <rollingPolicy
        class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
        <!-- roll over daily and when the file reaches 10 MB, max of 7 days or 3GB threshold -->
        <fileNamePattern>/data/storage/log/cms.%d{yyyy-MM-dd}.%i.Logs.gz
        </fileNamePattern>
        <maxFileSize>100MB</maxFileSize>
        <maxHistory>7</maxHistory>
        <totalSizeCap>3GB</totalSizeCap>
    </rollingPolicy>
</appender>
<appender name="SPECIFIC_CLASS" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${DEV_HOME}/sizeTimeOutputlogFile.log</file>
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <pattern>[%d{yyyy-MM-dd HH:mm:ss}] %p %c{1.} [%t]- %m%n</pattern>
    </encoder>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>${DEV_HOME}/archived/sizeTimeOutputlogFile.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
        <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
            <!--Max Size of file to start Archive -->
            <maxFileSize>10KB</maxFileSize>
        </timeBasedFileNamingAndTriggeringPolicy>

        <!-- Days till log history to keep -->
        <maxHistory>3</maxHistory>
    </rollingPolicy>
</appender>
<!--syslog appender-->
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
    <syslogHost>127.0.0.1</syslogHost>
    <facility>LOCAL0</facility>
    <port>514</port>
    <throwableExcluded>true</throwableExcluded>
    <suffixPattern>%thread: %-5level %logger{36} - %msg%n</suffixPattern>
</appender>

<!-- LOG everything at ERROR level -->
<root level="ERROR">
    <appender-ref ref="RollingFile" />
    <appender-ref ref="Console" />
</root>

<!-- LOG "com.myapp*" at ERROR level -->
<logger name="com.myapp" level="ERROR" additivity="false">
    <appender-ref ref="RollingFile" />
    <appender-ref ref="Console" />
</logger>
<logger name="sysLogger" level="DEBUG" additivity="false">
    <appender-ref ref="SYSLOG" />
</logger>
</code>```

below is log4j2.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Configuration strict="true" name="XMLConfig">
<Appenders>
    <Syslog name="Syslog" format="RFC5424" host="localhost" port="514"
            protocol="UDP" appName="cms" facility="LOCAL0" />
</Appenders>

<Loggers>
    <Logger name="com.mavenir.cms.vnf.util.ActivityLogAspect" level ="debug" additivity="false">
        <AppenderRef ref="Syslog"/>
    </Logger>
</Loggers>
</Configuration>
</code>```

But when I run my application syslog does not work.

I could not move from logback to log4j2 because I could not find an equivalent rollingAppender in log4j2.

Body:
Hi I have a requirement to configure both logback and log4j2 in my spring-boot application.
It all started with Syslog. Initially, my application had only logback.xml configuration, and I had configured the Syslog appender. But logback does not have support to RFC5424 format. But this is supported in log4j2.

Hence I wanted to configure both which would suffice both of my requirements.

Below is my logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="DEV_HOME" value="/data/storage/log"></property>
<appender name="Console"
    class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>
            %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
        </Pattern>
    </layout>
</appender>

<appender name="RollingFile"
    class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/data/storage/log/cms.log</file>
    <encoder
        class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
    </encoder>

    <rollingPolicy
        class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">

        <fileNamePattern>/data/storage/log/cms.%d{yyyy-MM-dd}.%i.Logs.gz
        </fileNamePattern>
        <maxFileSize>100MB</maxFileSize>
        <maxHistory>7</maxHistory>
        <totalSizeCap>3GB</totalSizeCap>
    </rollingPolicy>
</appender>
<appender name="SPECIFIC_CLASS" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${DEV_HOME}/sizeTimeOutputlogFile.log</file>
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <pattern>[%d{yyyy-MM-dd HH:mm:ss}] %p %c{1.} [%t]- %m%n</pattern>
    </encoder>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <fileNamePattern>${DEV_HOME}/archived/sizeTimeOutputlogFile.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
        <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">

            <maxFileSize>10KB</maxFileSize>
        </timeBasedFileNamingAndTriggeringPolicy>

        <maxHistory>3</maxHistory>
    </rollingPolicy>
</appender>

<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
    <syslogHost>127.0.0.1</syslogHost>
    <facility>LOCAL0</facility>
    <port>514</port>
    <throwableExcluded>true</throwableExcluded>
    <suffixPattern>%thread: %-5level %logger{36} - %msg%n</suffixPattern>
</appender>

<root level="ERROR">
    <appender-ref ref="RollingFile" />
    <appender-ref ref="Console" />
</root>

<logger name="com.myapp" level="ERROR" additivity="false">
    <appender-ref ref="RollingFile" />
    <appender-ref ref="Console" />
</logger>
<logger name="sysLogger" level="DEBUG" additivity="false">
    <appender-ref ref="SYSLOG" />
</logger>

below is log4j2.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<Configuration strict="true" name="XMLConfig">
<Appenders>
    <Syslog name="Syslog" format="RFC5424" host="localhost" port="514"
            protocol="UDP" appName="cms" facility="LOCAL0" />
</Appenders>

<Loggers>
    <Logger name="com.mavenir.cms.vnf.util.ActivityLogAspect" level ="debug" additivity="false">
        <AppenderRef ref="Syslog"/>
    </Logger>
</Loggers>
</Configuration>

But when I run my application syslog does not work.

I could not move from logback to log4j2 because I could not find an equivalent rollingAppender in log4j2.


问:
setSpeakerphoneOn not working in AudioManager in android
I am developing an app for Android. I am facing one problem. I couldn't put on the speaker. I use setSpeakerphoneOn function in AudioManager but it doesn't work.

```<code>  audioManager = getSystemService(AUDIO_SERVICE) as AudioManager;
  audioManager.setSpeakerphoneOn(true);
</code>```

Kindly help me to solve this. Thanks in advance.

Body:
I am developing an app for Android. I am facing one problem. I couldn't put on the speaker. I use setSpeakerphoneOn function in AudioManager but it doesn't work.

  audioManager = getSystemService(AUDIO_SERVICE) as AudioManager;
  audioManager.setSpeakerphoneOn(true);

Kindly help me to solve this. Thanks in advance.


问:
How to get multiple clicks or multiple enter keys in django form?
I have a post form in Django. When this form submits, I want a 2nd submit event not to occur until the result is returned. For this, I added the button disable property after it was clicked. Even if the button is disabled, when the button is pressed repeatedly while the page is loading, or when it is entered, the same actions are recorded in the database. How can I prevent this?

This is my HTML form

```<code><form action="{% url 'neworder' %}" method="POST">
<!-- <form action="#" method="POST"> -->
    {% csrf_token %}
    <div class="form-group">
        <label for="username">Kullanıcı Adı</label>
        <hr>
        <input type="text" placeholder='Kullanıcı adınız' class="form-control" name="username" id="username" required>
        <br>
        <label for="bonustur">Bonus Türü</label>
        <hr>

            <select name="orders"  id='ordervalue' class="form-control" required>
              {% for x in orders %}
                {% if x.status == True %}
                <option value="{{x.orderid}}" style="font-weight: bolder;">{{x.ordername}}</option>
                {% endif %}
              {% endfor %}

            </select>

        <br>

        <button type="submit" class="btn btn-success btn-load form-control" type="submit" id="button">
          <span class="d-flex align-items-center">
            <span class="flex-grow-1 me-2">Check</span>
            <span class="spinner-border flex-shrink-0" role="status" style="display: none;">
            </span>
          </span>
        </button>
        <!-- <button type="submit" class="btn btn-success form-control" id="button">Talep Et

        </button> -->
    </div>

</form>
</code>```

The JQuery codes I've tried to prevent this multiple clicks

```<code><script>
  jQuery(function($){
    $("#button").click(function(){
      $.ajax({
        type:'POST',
        success: function(data){
          console.log(data);
        }
      }).done(function(){
        setTimeout(function() {
          $("#button").prop('disabled', 'true');
          $("#button").text('Checking');
          $(".spinner-border").css('display', 'block');

        })

      })
    })
  })
</script>
</code>```

Body:
I have a post form in Django. When this form submits, I want a 2nd submit event not to occur until the result is returned. For this, I added the button disable property after it was clicked. Even if the button is disabled, when the button is pressed repeatedly while the page is loading, or when it is entered, the same actions are recorded in the database. How can I prevent this?

This is my HTML form

<form action="{% url 'neworder' %}" method="POST">

    {% csrf_token %}

        Kullanıcı Adı

        <input type="text" placeholder='Kullanıcı adınız' class="form-control" name="username" id="username" required>

        Bonus Türü

            <select name="orders"  id='ordervalue' class="form-control" required>
              {% for x in orders %}
                {% if x.status == True %}
                <option value="{{x.orderid}}" style="font-weight: bolder;">{{x.ordername}}</option>
                {% endif %}
              {% endfor %}

            </select>

        <button type="submit" class="btn btn-success btn-load form-control" type="submit" id="button">

            Check

        </button>

</form>

The JQuery codes I've tried to prevent this multiple clicks


问:
Auto finger print and don't track option in dolphin anty software?
Need guidance about dolphin anty settings.

How can we set auto finger print and don't track option in dolphin anty web software?

can we create shortcut for this purpose?

or

can we any extension for this purpose?

i am working on dolphin anty browser software and i have to do fingerprint refresh and do not track my proxy after every 5 mins on almost 20-40 profiles. So, i want to create a shortcut for this purpose or auto finger print refresh and do not option in software.


问:
How to retrieve all the attribute / namespace of particular xml element c#
I'm using the below xml file I want to get all the attributes of <package>/namespace of  element . How to get those namespace in XmlSerializerNamespaces or XPath to get this element alone

Expected Output

```<code><package xmlns:xsd="http://www.w3.org/2001/XMLSchema"nxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</code>```

Tried:

C#

```<code>XDocument document = XDocument.Load(file.xml);
XNamespace ns = document.Root.GetDefaultNamespace();
var results = document.Root.Elements().Select(x => x.Element("package").GetDefaultNamespace());
var result = document.XPathSelectElement("package").GetDefaultNamespace();
</code>```

For this XML

```<code>  <package xmlns:xsd="http://www.w3.org/2001/XMLSchema"nxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    ...
    <example>
      ...
    </example>
  </package>
</code>```

Please help!

Body:
I'm using the below xml file I want to get all the attributes of <package>/namespace of  element . How to get those namespace in XmlSerializerNamespaces or XPath to get this element alone

Expected Output

<package xmlns:xsd="http://www.w3.org/2001/XMLSchema"nxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Tried:

C#

XDocument document = XDocument.Load(file.xml);
XNamespace ns = document.Root.GetDefaultNamespace();
var results = document.Root.Elements().Select(x => x.Element("package").GetDefaultNamespace());
var result = document.XPathSelectElement("package").GetDefaultNamespace();

For this XML

  <package xmlns:xsd="http://www.w3.org/2001/XMLSchema"nxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    ...
    <example>
      ...
    </example>
  </package>

Please help!


问:
AR Core - Record camera motion
How can I track the motion of the camera in AR Core so as to have a good estimate of the path the camera took while the user was moving their phone?</p>

Title: AR Core - Record camera motion


问:
How to handle exception in reactive java
I have below two method where I have to handle exception.

Suppose during save some exception occured. How to handle it. Here return type of saveProduct is Mono<Book>.

```<code>public Mono<Book> saveProduct(Book product){

        return bookRepository.save(product)

    }
</code>```
```<code>How to handle exception if it occurs at step1 or step2 or step3. Here return type of saveProduct is Mono<Book>.
public Mono<Book> getProductById(Book book) {

        //When we receive the GET request, we would first check the cache, if it is present,
        //we would simply return it.Otherwise, we would query the DB and store in the cache for
        //future use.

   return   hashOperations.get(KEY,book.getId()).    //step1
            switchIfEmpty(bookRepository.findById(book.getId()))   //step2
            .flatMap(dto -> this.hashOperations.put(KEY,book.getId(),dto)  //step 3
            .thenReturn(dto));

    }
</code>```

Body:
I have below two method where I have to handle exception.

Suppose during save some exception occured. How to handle it. Here return type of saveProduct is Mono<Book>.

public Mono<Book> saveProduct(Book product){

        return bookRepository.save(product)

    }

How to handle exception if it occurs at step1 or step2 or step3. Here return type of saveProduct is Mono<Book>.
public Mono<Book> getProductById(Book book) {

        //When we receive the GET request, we would first check the cache, if it is present,
        //we would simply return it.Otherwise, we would query the DB and store in the cache for
        //future use.

   return   hashOperations.get(KEY,book.getId()).    //step1
            switchIfEmpty(bookRepository.findById(book.getId()))   //step2
            .flatMap(dto -> this.hashOperations.put(KEY,book.getId(),dto)  //step 3
            .thenReturn(dto));

    }


问:
undefined column selected error in Shiny app
I just want to imitate to make a little shiny app.
but it does not work at all.

```<code>ERORR is: Warning: Error in [.data.frame: undefined columns selected
</code>```

I load a df I created.

```<code>data.frame : df_pris_salary
colnames : region ,  år , Antal ,Medelpris, Medianpris ,MedelLön year_per_lgh
</code>```

Code looks like this:

```<code>library(shiny)
library(tidyverse)
library(ggplot2)

load("data/shiny2.RData")
# load df: df_pris_salary

ui <- fluidPage(

  titlePanel("Utveckling av lägenhetspris & Lön"),

  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "VarX",
                  label = "Select X-axis Variable:",
                  choices = list("år", "MedelLön")),
      selectInput(inputId = "VarY",
                  label = "Select Y-axis Variable:",
                  choices = list("Medelpris", "MedelLön")),
      selectInput(inputId = "Color",
                  label = "Select Color Variable:",
                  choices = as.list(c("region", "år")))
    ),

    mainPanel(
      plotOutput("scatter")
    )
  )
)

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

  output$scatter <- renderPlot({

    mtc <- df_pris_salary[,c(input$VarX, input$VarY, input$Color)]
    mtc[,3] <- as.factor(mtc[,3])

    ggplot()+
      geom_line(data = mtc, aes(x = mtc[,1], y = mtc[,2], color = mtc[,3]))+
      geom_point(data = mtc, aes(x = mtc[,1], y = mtc[,2], color = mtc[,3]))+
      labs(x = colnames(mtc)[1], y = colnames(mtc)[2],
           color = colnames(mtc)[3],
           title = paste("Scatter Plot of", input$VarX, "vs", input$VarY),
           subtitle = "Under åren 2000 - 2021",
           caption = "Data Source: SCB")

  })
}

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

Could someone help me to figure out how to solve this problem?

Body:
I just want to imitate to make a little shiny app.
but it does not work at all.

ERORR is: Warning: Error in [.data.frame: undefined columns selected

I load a df I created.

data.frame : df_pris_salary
colnames : region ,  år , Antal ,Medelpris, Medianpris ,MedelLön year_per_lgh

Code looks like this:

library(shiny)
library(tidyverse)
library(ggplot2)

load("data/shiny2.RData")
# load df: df_pris_salary

ui <- fluidPage(

  titlePanel("Utveckling av lägenhetspris & Lön"),

  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "VarX",
                  label = "Select X-axis Variable:",
                  choices = list("år", "MedelLön")),
      selectInput(inputId = "VarY",
                  label = "Select Y-axis Variable:",
                  choices = list("Medelpris", "MedelLön")),
      selectInput(inputId = "Color",
                  label = "Select Color Variable:",
                  choices = as.list(c("region", "år")))
    ),

    mainPanel(
      plotOutput("scatter")
    )
  )
)

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

  output$scatter <- renderPlot({

    mtc <- df_pris_salary[,c(input$VarX, input$VarY, input$Color)]
    mtc[,3] <- as.factor(mtc[,3])

    ggplot()+
      geom_line(data = mtc, aes(x = mtc[,1], y = mtc[,2], color = mtc[,3]))+
      geom_point(data = mtc, aes(x = mtc[,1], y = mtc[,2], color = mtc[,3]))+
      labs(x = colnames(mtc)[1], y = colnames(mtc)[2],
           color = colnames(mtc)[3],
           title = paste("Scatter Plot of", input$VarX, "vs", input$VarY),
           subtitle = "Under åren 2000 - 2021",
           caption = "Data Source: SCB")

  })
}

shinyApp(ui, server)

Could someone help me to figure out how to solve this problem?


问:
Cannot parse JSON Schema to a UI Form
I'm trying to understand how to build a schema for my form.
The data I want to store and build schema for is:

{ "aliases": { "balbalbla": ["x", "y"], "chhhhhxxxx": ["w", "q"] }
```
<p>The schema I configured:</p>
<pre class="lang-json prettyprint-override"><code>{
  "title": "A registration form",
  "description": "A simple form example.",
  "type": "object",
  "properties": {
    "aliases": {
    "title": "Aliases",
    "description": "Inflint aliases to use together with rules.",
    "type": "object",
    "additionalProperties": {
      "type": "array",
      "items": [
        {
          "title": "RegEx Matcher",
          "description": "Inflint will apply the alias name to match the provided RegEx.",
          "type": "string"
        },
        {
          "title": "RegEx Flags",
          "description": "Inflint will apply the flags together with the RegEx string.",
          "type": "string"
        }
      ]
    }
}}}
</code>```

But if I go to playground of this package I use, this won't render as needed: https://rjsf-team.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6eyJmaXJzdE5hbWUiOiJDaHVjayIsImxhc3ROYW1lIjoiTm9ycmlzIiwiYWdlIjo3NSwiYmlvIjoiUm91bmRob3VzZSBraWNraW5nIGFzc2VzIHNpbmNlIDE5NDAiLCJwYXNz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lkZ2V0IjoidGV4dGFyZWEifSwicGFzc3dvcmQiOnsidWk6d2lkZ2V0IjoicGFzc3dvcmQiLCJ1aTpoZWxwIjoiSGludDogTWFrZSBpdCBzdHJvbmchIn0sImRhdGUiOnsidWk6d2lkZ2V0IjoiYWx0LWRhdGV0aW1lIn0sInRlbGVwaG9uZSI6eyJ1aTpvcHRpb25zIjp7ImlucHV0VHlwZSI6InRlbCJ9fX0sInRoZW1lIjoiZGVmYXVsdCIsImxpdmVTZXR0aW5ncyI6eyJzaG93RXJyb3JMaXN0IjoidG9wIiwidmFsaWRhdGUiOmZhbHNlLCJkaXNhYmxlIjpmYWxzZSwicmVhZG9ubHkiOmZhbHNlLCJvbWl0RXh0cmFEYXRhIjpmYWxzZSwibGl2ZU9taXQiOmZhbHNlfX0=

does anyone could tell why?

Title: Cannot parse JSON Schema to a UI Form

Body:
I'm trying to understand how to build a schema for my form.
The data I want to store and build schema for is:

{ "aliases": { "balbalbla": ["x", "y"], "chhhhhxxxx": ["w", "q"] }

The schema I configured:

{
  "title": "A registration form",
  "description": "A simple form example.",
  "type": "object",
  "properties": {
    "aliases": {
    "title": "Aliases",
    "description": "Inflint aliases to use together with rules.",
    "type": "object",
    "additionalProperties": {
      "type": "array",
      "items": [
        {
          "title": "RegEx Matcher",
          "description": "Inflint will apply the alias name to match the provided RegEx.",
          "type": "string"
        },
        {
          "title": "RegEx Flags",
          "description": "Inflint will apply the flags together with the RegEx string.",
          "type": "string"
        }
      ]
    }
}}}

But if I go to playground of this package I use, this won't render as needed: <a href="https://rjsf-team.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6eyJmaXJzdE5hbWUiOiJDaHVjayIsImxhc3ROYW1lIjoiTm9ycmlzIiwiYWdlIjo3NSwiYmlvIjoiUm91bmRob3VzZSBraWNraW5nIGFzc2VzIHNpbmNlIDE5NDAiLCJwYXNzd29yZCI6Im5vbmVlZCJ9LCJzY2hlbWEiOnsidGl0bGUiOiJBIHJlZ2lzdHJhdGlvb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lIjoic3RyaW5nIn0seyJ0aXRsZSI6IlJlZ0V4IEZsYWdzIiwiZGVzY3JpcHRpb24iOiJJbmZsaW50IHdpbGwgYXBwbHkgdGhlIGZsYWdzIHRvZ2V0aGVyIHdpdGggdGhlIFJlZ0V4IHN0cmluZy4iLCJ0eXBlIjoic3RyaW5nIn1dfX19fSwidWlTY2hlbWEiOnsiZmlyc3ROYW1lIjp7InVpOmF1dG9mb2N1cyI6dHJ1ZSwidWk6ZW1wdHlWYWx1ZSI6IiIsInVpOmF1dG9jb21wbGV0ZSI6ImZhbWlseS1uYW1lIn0sImxhc3ROYW1lIjp7InVpOmVtcHR5VmFsdWUiOiIiLCJ1aTphdXRvY29tcGxldGUiOiJnaXZlbi1uYW1lIn0sImFnZSI6eyJ1aTp3aWRnZXQiOiJ1cGRvd24iLCJ1aTp0aXRsZSI6IkFnZSBvZiBwZXJzb24iLCJ1aTpkZXNjcmlwdGlvbiI6IihlYXJ0aGlhbiB5ZWFyKSJ9LCJiaW8iOnsidWk6d2lkZ2V0IjoidGV4dGFyZWEifSwicGFzc3dvcmQiOnsidWk6d2lkZ2V0IjoicGFzc3dvcmQiLCJ1aTpoZWxwIjoiSGludDogTWFrZSBpdCBzdHJvbmchIn0sImRhdGUiOnsidWk6d2lkZ2V0IjoiYWx0LWRhdGV0aW1lIn0sInRlbGVwaG9uZSI6eyJ1aTpvcHRpb25zIjp7ImlucHV0VHlwZSI6InRlbCJ9fX0sInRoZW1lIjoiZGVmYXVsdCIsImxpdmVTZXR0aW5ncyI6eyJzaG93RXJyb3JMaXN0IjoidG9wIiwidmFsaWRhdGUiOmZhbHNlLCJkaXNhYmxlIjpmYWxzZSwicmVhZG9ubHkiOmZhbHNlLCJvbWl0RXh0cmFEYXRhIjpmYWxzZSwibGl2ZU9taXQiOmZhbHNlfX0=

does anyone could tell why?


问:
No module named 'stix2'
I Installed stix2 by
pip install stix2

It was working but I had to restart the system because I was having some touchpad issues/erratic pointer. After rebooting the system, I started getting ModuleNotFoundError.

So I uninstalled and reinstalled stix2. Thus when I "pip install stix2" now it says "Requirement already satisfied". pip list also shows stix2. But python can't import it still.

```<code>>>> import stix2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'stix2'
</code>```

Title: No module named 'stix2'

Body:
I Installed stix2 by
pip install stix2

It was working but I had to restart the system because I was having some touchpad issues/erratic pointer. After rebooting the system, I started getting ModuleNotFoundError.

So I uninstalled and reinstalled stix2. Thus when I "pip install stix2" now it says "Requirement already satisfied". pip list also shows stix2. But python can't import it still.

>>> import stix2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'stix2'


问:
HPC cluster: select the number of Threads in SLURM sbatch when run Ansys Fluent
I'm running Fluent on HPC via Slurm and have a question: Fluent use processors(threads) to solve. Currently i can only request Cores count on Slurm using --ntasks=64. So is there a way to request the number of threads?

Exp: I have 2 node

Node 1: 32 cores, 64 threads

Node 2: 32 cores, 32 threads
So when i run with --ntasks=64, Slurm using 2 node, so lose 32 threads, and i can not request more than 64 threads (I think Slurm is understanding 64 cores)
Actually when we call 64 threads only Node 1 is needed. Right?

Above is an example, my HPC actually has many nodes like that and i want to request threads without specifying it because the configuration of the nodes is different.


问:
How do I interpret the results of a difference-in-differences method with categorical values?
I did a difference-in-differences model with the following variables in R:

Treated: 1 if the observation is in the treatment group (0 otherwise)

Post: 1 if the observation is in the post-treatment period (0 otherwise)

Industry (I defined the variable as a factor in R): I have 11 industries. Depending in which industry the observation is, a number from 1-11 is allocated to it.

How do I interpret my results (see picture) of the variables Treated:Post:IndustryX?

Thank you very much!

P.S. I have googled a lot to find any answers but was not really able to find anything. I am not even sure if I can interpret the coefficients / if I can even apply this method like this.*


问:
Trouble specifying compiler path in C/C++ extensions in vscode
I am coding a c app on a distant server (Using VScode Remote).
I want to specify my sdk compilator to the c/c++ vscode extension in order to make Intellisens working properly.

I have tried to specify the compilator path in the settings.json like this :

```<code>{
    "C_Cpp.default.compilerPath": "/opt/toolchains/arm-buildroot-linux-gnueabihf_sdk-builroot/bin/arm-linux-gnueabihf-gcc",
    "C_Cpp.loggingLevel": "Debug"
}
</code>```

But in the debug output, it says that it hasn't found the compilator :

```<code>Attempting to get defaults from C++ compiler in "compilerPath" property: '/opt/toolchains/arm-buildroot-linux-gnueabihf_sdk-builroot/bin/arm-linux-gnueabihf-gcc'
Specified compiler was not found: /opt/toolchains/arm-buildroot-linux-gnueabihf_sdk-builroot/bin/arm-linux-gnueabihf-gcc
</code>```

I was expecting it was dealing with rights on the sdk folder but even with chmod 777 it doesn't work.

Body:
I am coding a c app on a distant server (Using VScode Remote).
I want to specify my sdk compilator to the c/c++ vscode extension in order to make Intellisens working properly.

I have tried to specify the compilator path in the settings.json like this :

{
    "C_Cpp.default.compilerPath": "/opt/toolchains/arm-buildroot-linux-gnueabihf_sdk-builroot/bin/arm-linux-gnueabihf-gcc",
    "C_Cpp.loggingLevel": "Debug"
}

But in the debug output, it says that it hasn't found the compilator :

Attempting to get defaults from C++ compiler in "compilerPath" property: '/opt/toolchains/arm-buildroot-linux-gnueabihf_sdk-builroot/bin/arm-linux-gnueabihf-gcc'
Specified compiler was not found: /opt/toolchains/arm-buildroot-linux-gnueabihf_sdk-builroot/bin/arm-linux-gnueabihf-gcc

I was expecting it was dealing with rights on the sdk folder but even with chmod 777 it doesn't work.


问:
How to fire a click/change event for a custom address with google place autocomplete address in angular 13
I am using google place autocomplete and it's working fine. But I need to add some custom addresses from DB. I did it by custom HTML by catching google place autocomplete CSS class name like (.pac-container).

@ViewChild('addressSearch') addresstext!: ElementRef;

  chnageAddress(event: any) {
    this.aa = (<HTMLElement>document.querySelector('.pac-container'));
    let item = '
Local Address 1
';
    item += '
Local Address 2
';
    this.aa.innerHTML = item;

    (<HTMLElement>document.querySelector('.pac-item')).addEventListener('click',
      this.showMap.bind(this));
  }

  showMap() {
    alert('action from custom place');
  }

  getPlaceAutocomplete() {
    const autocomplete = new google.maps.places.Autocomplete(this.addresstext.nativeElement,
      {
        types: ['establishment', 'geocode']
      });

    google.maps.event.addListener(autocomplete, 'place_changed', () => {
      this.ref.detach();

      setInterval(() => { this.ref.detectChanges(); }, 200);

    });
  }```
<pre class="snippet-code-html lang-html prettyprint-override"><code> <div class="input-group">
                          <input (input)="chnageAddress($event);" formControlName="addressSearch" type="text"
                            placeholder="search address" #addressSearch id="addressSearch" class="form-control"
                            leftTrim>
                          <span class="input-group-text">
                            <i class="icon-target"></i>
                          </span>
                          <img src="assets/images/pwb-google-maps.svg" alt="" class="powered-by-logo">
                        </div></code>```

Now the problem is custom event not fired for my custom address. I have tried in different ways.

Note: Google place autocomplete default change event working only for goole address not custom address.

Someone tell me where is my wrong and who to solve, Thanks to all.

Body:
I am using google place autocomplete and it's working fine. But I need to add some custom addresses from DB. I did it by custom HTML by catching google place autocomplete CSS class name like (.pac-container).

@ViewChild('addressSearch') addresstext!: ElementRef;

  chnageAddress(event: any) {
    this.aa = (<HTMLElement>document.querySelector('.pac-container'));
    let item = '
Local Address 1
';
    item += '
Local Address 2
';
    this.aa.innerHTML = item;

    (<HTMLElement>document.querySelector('.pac-item')).addEventListener('click',
      this.showMap.bind(this));
  }

  showMap() {
    alert('action from custom place');
  }

  getPlaceAutocomplete() {
    const autocomplete = new google.maps.places.Autocomplete(this.addresstext.nativeElement,
      {
        types: ['establishment', 'geocode']
      });

    google.maps.event.addListener(autocomplete, 'place_changed', () => {
      this.ref.detach();

      setInterval(() => { this.ref.detectChanges(); }, 200);

    });
  }

                          <input (input)="chnageAddress($event);" formControlName="addressSearch" type="text"
                            placeholder="search address" #addressSearch id="addressSearch" class="form-control"
                            leftTrim>

Now the problem is custom event not fired for my custom address. I have tried in different ways.

Note: Google place autocomplete default change event working only for goole address not custom address.

Someone tell me where is my wrong and who to solve, Thanks to all.