问:
Unable to display iplot visualization on google colab
I'm trying to visualize my data, I have import pandas and plotly. The problem is it run normal but no visual show up. Here is the code

All the librarys I import:

```<code>%matplotlib inline

from math import sqrt
from numpy import concatenate
from matplotlib import pyplot
import pandas as pd
from datetime import datetime
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
import plotly.offline as py
import plotly.graph_objs as go
import plotly.tools as tls
import numpy as np
import seaborn as sns

py.init_notebook_mode(connected=False)
</code>```

Import data:

```<code>data = pd.read_csv(filepath_or_buffer="data.csv", index_col="Date")
</code>```

And convert to timedate:

```<code>data.index = pd.to_datetime(data.index)
</code>```

And yet when I try to visualize the data nothing show up

```<code>btc_trace = go.Scatter(x=data.index, y=data['Volume'], name= 'Price')
py.iplot([btc_trace])
</code>```

Body:
I'm trying to visualize my data, I have import pandas and plotly. The problem is it run normal but no visual show up. Here is the code

All the librarys I import:

%matplotlib inline

from math import sqrt
from numpy import concatenate
from matplotlib import pyplot
import pandas as pd
from datetime import datetime
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
import plotly.offline as py
import plotly.graph_objs as go
import plotly.tools as tls
import numpy as np
import seaborn as sns

py.init_notebook_mode(connected=False)

Import data:

data = pd.read_csv(filepath_or_buffer="data.csv", index_col="Date")

And convert to timedate:

data.index = pd.to_datetime(data.index)

And yet when I try to visualize the data nothing show up

btc_trace = go.Scatter(x=data.index, y=data['Volume'], name= 'Price')
py.iplot([btc_trace])


来源: stackexchange

问:
ssl sock didn't decrypt response of http
Here is the my ssl-socket code:

```<code>import ssl, socket

data = b'GET / HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nHost: www.google.com.hk\r\nUser-Agent: HTTPie/0.9.8\r\n\r\n'

context = ssl._create_default_https_context()
context.post_handshake_auth = True
context.check_hostname = True

sock = socket.create_connection(('www.google.com.hk', 443), 5, None)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

sslsock = context.wrap_socket(sock, server_hostname='www.google.com.hk')
sslsock.sendall(data)
while rv := sslsock.recv(1000):
    print(rv.decode('utf8', errors='ignore'))
</code>```

Through above code, I could get plain text of 200 OK headers of response, but the response body is till encrypted. I don't know why it is so. And I have been thinking I do exactly the same as builtin package http.client.

For example the code works well using http.client:

```<code>import http.client
conn = http.client.HTTPSConnection("www.google.com.hk")
conn.request("GET", "/", headers={'Host': 'www.google.com.hk', 'User-Agent': 'HTTPie/0.9.8'})
while rv := conn.sock.recv(1000):
    print(rv.decode('utf8', 'ignore'))
</code>```

Please point out why my ssl-socket don't work and how to correct it

ContentLicense: CC BY-SA 4.0

Body:
Here is the my ssl-socket code:

import ssl, socket

data = b'GET / HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nHost: www.google.com.hk\r\nUser-Agent: HTTPie/0.9.8\r\n\r\n'

context = ssl._create_default_https_context()
context.post_handshake_auth = True
context.check_hostname = True

sock = socket.create_connection(('www.google.com.hk', 443), 5, None)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

sslsock = context.wrap_socket(sock, server_hostname='www.google.com.hk')
sslsock.sendall(data)
while rv := sslsock.recv(1000):
    print(rv.decode('utf8', errors='ignore'))

Through above code, I could get plain text of 200 OK headers of response, but the response body is till encrypted. I don't know why it is so. And I have been thinking I do exactly the same as builtin package http.client.

For example the code works well using http.client:

import http.client
conn = http.client.HTTPSConnection("www.google.com.hk")
conn.request("GET", "/", headers={'Host': 'www.google.com.hk', 'User-Agent': 'HTTPie/0.9.8'})
while rv := conn.sock.recv(1000):
    print(rv.decode('utf8', 'ignore'))

Please point out why my ssl-socket don't work and how to correct it


问:
Change font size in JSPDF
I want to change the font size in my pdf but i can´t

I tried to use doc.setFontSize(2) for example but i only can in a hardcode variable for example

```<code>let title = 'Hello world'
doc.setFontSize(2)    -----> thats works but if i want to change this below:

let stringRange =  padLessTen(segment.dates.start.getHours()) + ":" + padLessTen(segment.dates.start.getMinutes())
        + ' - ' + padLessTen(segment.dates.end.getHours()) + ":" + padLessTen(segment.dates.end.getMinutes())

        return  `${stringRange}`
      };

</code>```

This is a variable that returns hours and I want to lower the font size of those hours i tried with everything doc.setFontSize(2) or styles: { fontSize(2) }  if i return ${stringRange} + doc.setFontSize(2) it said 11:45 {object Object} and dont change the size

Title: Change font size in JSPDF

Body:
I want to change the font size in my pdf but i can´t

I tried to use doc.setFontSize(2) for example but i only can in a hardcode variable for example

let title = 'Hello world'
doc.setFontSize(2)    -----> thats works but if i want to change this below:

let stringRange =  padLessTen(segment.dates.start.getHours()) + ":" + padLessTen(segment.dates.start.getMinutes())
        + ' - ' + padLessTen(segment.dates.end.getHours()) + ":" + padLessTen(segment.dates.end.getMinutes())

        return  `${stringRange}`
      };

This is a variable that returns hours and I want to lower the font size of those hours i tried with everything doc.setFontSize(2) or styles: { fontSize(2) }  if i return ${stringRange} + doc.setFontSize(2) it said 11:45 {object Object} and dont change the size


问:
Mapped super class error after creating entity inside folder
I created a folder Admin under Entity folder. Inside Admin, there is an entity User.php

```<code>namespace App\Entity\Admin;

use App\Repository\Admin\UserRepository;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Exception;

#[ORM\Table(name: 'admin_journal')]
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\HasLifecycleCallbacks]
class User
</code>```

When I try insert, it is giving me Class "App\Entity\Admin\User" is not a valid entity or mapped super class. error

At doctrine.yaml, I added following Admin changes

```<code>orm:
    auto_generate_proxy_classes: true
    naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
    auto_mapping: true
    mappings:
        App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
            alias: App
        Admin:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity/Admin'
            prefix: 'App\Entity\Admin'
</code>```

Can anybody tell me what is wrong here ?

Body:
I created a folder Admin under Entity folder. Inside Admin, there is an entity User.php

namespace App\Entity\Admin;

use App\Repository\Admin\UserRepository;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Exception;

#[ORM\Table(name: 'admin_journal')]
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\HasLifecycleCallbacks]
class User

When I try insert, it is giving me Class "App\Entity\Admin\User" is not a valid entity or mapped super class. error

At doctrine.yaml, I added following Admin changes

orm:
    auto_generate_proxy_classes: true
    naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
    auto_mapping: true
    mappings:
        App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
            alias: App
        Admin:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity/Admin'
            prefix: 'App\Entity\Admin'

Can anybody tell me what is wrong here ?


问:
es cumulative_sum cannot support the number of returned docs
I got a confusion that how to specify the number of returned docs from cumulative_sum aggs, this is my search:

```<code>{
        "query": {"match_all": {}},
        "size": 0,
        "aggs": {
          "group_by_date": {
            "date_histogram": {
              "field": "timestamp",
              "interval": "day"
            },
            "aggs": {
              "cumulative_docs": {
                "cumulative_sum": {"buckets_path": "_count"}
              }
            }
          }
        }
      }
</code>```

and it returns max number of buckets

```<code>"aggregations" : {
    "group_by_date" : {
      "buckets" : [
        {
          "key_as_string" : "2022-09-03T00:00:00.000Z",
          "key" : 1662163200000,
          "doc_count" : 19,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-04T00:00:00.000Z",
          "key" : 1662249600000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-05T00:00:00.000Z",
          "key" : 1662336000000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-06T00:00:00.000Z",
          "key" : 1662422400000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-07T00:00:00.000Z",
          "key" : 1662508800000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-08T00:00:00.000Z",
          "key" : 1662595200000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
...
</code>```

I tried to use bucket_selector to filter top10 or N in cumulative_sum but its return error such like can not support sub aggs in cumulative_sum, and also tried to use size param but not support.

if I wanna return only ten or more(I can specify it myself), how can I revise my code here?

Body:
I got a confusion that how to specify the number of returned docs from cumulative_sum aggs, this is my search:

{
        "query": {"match_all": {}},
        "size": 0,
        "aggs": {
          "group_by_date": {
            "date_histogram": {
              "field": "timestamp",
              "interval": "day"
            },
            "aggs": {
              "cumulative_docs": {
                "cumulative_sum": {"buckets_path": "_count"}
              }
            }
          }
        }
      }

and it returns max number of buckets

"aggregations" : {
    "group_by_date" : {
      "buckets" : [
        {
          "key_as_string" : "2022-09-03T00:00:00.000Z",
          "key" : 1662163200000,
          "doc_count" : 19,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-04T00:00:00.000Z",
          "key" : 1662249600000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-05T00:00:00.000Z",
          "key" : 1662336000000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-06T00:00:00.000Z",
          "key" : 1662422400000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-07T00:00:00.000Z",
          "key" : 1662508800000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
        {
          "key_as_string" : "2022-09-08T00:00:00.000Z",
          "key" : 1662595200000,
          "doc_count" : 0,
          "cumulative_docs" : {
            "value" : 19.0
          }
        },
...

I tried to use bucket_selector to filter top10 or N in cumulative_sum but its return error such like can not support sub aggs in cumulative_sum, and also tried to use size param but not support.

if I wanna return only ten or more(I can specify it myself), how can I revise my code here?


问:
ACF with Timber : group subitem can't be accessible
This is my first question on stackoverflow.

I have a problem with ACF and Timber. I have created an ACF group like this :

My acf group

I want to check if type_pre-footer = XXX,so in my Twig template I have made this :

```<code>{% if post.meta('pre-footer').type_pre-footer == 'Titre et liens' %}
    <section class="join-us">
        <img src="https://picsum.photos/1800/537" class="alwaysgray" alt="">
        <div class="top-right">
            <h5>Rejoignez-nous !</h5>
            <ul>
                <li>{{ macros.svg('arrow','12','as--white', assetsDir) }}
                    Offres d'emploi</li>
                <li>{{ macros.svg('arrow','12','as--white', assetsDir) }}
                    Candidature spontanée</li>
                <li>{{ macros.svg('arrow','12','as--white', assetsDir) }}
                    Recrutement d'équipes</li>
            </ul>
        </div>
...
</code>```

But it's not working, I have tried to display post.meta('pre-footer').type_pre-footer with a {{dump()}, but it return 'int(0)'. When I try to display only post.meta('pre-footer'), it return an array :

```<code>array(3) {
["type_pre-footer"]=> string(14) "Titre et liens"
["titreliens"]=> array(3) { ["titre"]=> string(0) "" ["liens"]=> bool(false) ["image"]=> string(0) "" }
["articles"]=> array(2) { ["titre"]=> string(0) "" ["articles"]=> bool(false) } }
</code>```

have you any idea about how to solve it ?

if you need more logs, you can ask me, thanks

Body:
This is my first question on stackoverflow.

I have a problem with ACF and Timber. I have created an ACF group like this :

My acf group

I want to check if type_pre-footer = XXX,so in my Twig template I have made this :

{% if post.meta('pre-footer').type_pre-footer == 'Titre et liens' %}

Rejoignez-nous !

{{ macros.svg('arrow','12','as--white', assetsDir) }}
                    Offres d'emploi

{{ macros.svg('arrow','12','as--white', assetsDir) }}
                    Candidature spontanée

{{ macros.svg('arrow','12','as--white', assetsDir) }}
                    Recrutement d'équipes

...

But it's not working, I have tried to display post.meta('pre-footer').type_pre-footer with a {{dump()}, but it return 'int(0)'. When I try to display only post.meta('pre-footer'), it return an array :

array(3) {
["type_pre-footer"]=> string(14) "Titre et liens"
["titreliens"]=> array(3) { ["titre"]=> string(0) "" ["liens"]=> bool(false) ["image"]=> string(0) "" }
["articles"]=> array(2) { ["titre"]=> string(0) "" ["articles"]=> bool(false) } }

have you any idea about how to solve it ?

if you need more logs, you can ask me, thanks


问:
How to map same colours to points and boxplots
I am trying to make a boxplot graph with data points in R but cannot match the colours of the boxplot and the points. Here is my code:

```<code>
ggplot(Data_expo, aes(x = Group, y = LogConcentration, fill = Planttype))+
  geom_boxplot(outlier.shape=NA) +
  geom_point(position=position_jitterdodge(), alpha = .1)+
  scale_fill_manual(values = alpha(c("#CD7F24", "#5F9EA0", "#698B22"), .5))+
  theme_light()+
  ylab("Log Concentration")

</code>```

And here what it looks like:

I want the same colour for data points with the boxplots as well.

I also tried this as well (the colours of the boxplots and the points match here but there is no filling inside the box plot which I try to do)

```<code>

ggplot(Data_expo, aes(x = Group, y = LogConcentration, colour = Planttype))+
  geom_boxplot(outlier.shape=NA) +
  geom_point(position=position_jitterdodge(), alpha = .1)+
  scale_colour_brewer(palette = "Dark2")+
  theme_light()+
  ylab("Log Concentration")

</code>```

Body:
I am trying to make a boxplot graph with data points in R but cannot match the colours of the boxplot and the points. Here is my code:

ggplot(Data_expo, aes(x = Group, y = LogConcentration, fill = Planttype))+
  geom_boxplot(outlier.shape=NA) +
  geom_point(position=position_jitterdodge(), alpha = .1)+
  scale_fill_manual(values = alpha(c("#CD7F24", "#5F9EA0", "#698B22"), .5))+
  theme_light()+
  ylab("Log Concentration")

And here what it looks like:

I want the same colour for data points with the boxplots as well.

I also tried this as well (the colours of the boxplots and the points match here but there is no filling inside the box plot which I try to do)

ggplot(Data_expo, aes(x = Group, y = LogConcentration, colour = Planttype))+
  geom_boxplot(outlier.shape=NA) +
  geom_point(position=position_jitterdodge(), alpha = .1)+
  scale_colour_brewer(palette = "Dark2")+
  theme_light()+
  ylab("Log Concentration")


问:
How to get drawable with hexadecimal ID in android studio
I got a Resource Not Found exception, but I do not know which drawable causes. Because, the app is in publish and I saw this error on Firebase crashlytics. This is run time error and this crash occurs on only one device - Nexus 5X (Android Version: 8.1.0)

Firebase says
Caused by android.content.res.Resources$NotFoundException: Resource ID #0x7f08029f

And, I want to find the drawable by this hexadecimal Resource ID. Is it possible? If it is, can you help me?

Thanks


问:
next auth oauth callback
Generates one time access code and calls callback URL defined in App settings case:

in this case
can i get another parameter? ex) api/auth/github/callback?code=123&test=1111

if include test parameter i want to route '/test' link

like this
how can i get another parameter and route link?

im trying to change callbacks in redirect
but it is not working...

Title: next auth oauth callback


问:
How to install a conda package into an existing environment with minimum required changes?
I have a lot (several tens) of conda environments. I need to install a new package. I'd prefer not to create a new environment specifically for it, but rather find an existing one that requires minimum change to install the package into it. How do I do this programmatically (without manually checking each environment)?

I could imagine obtaining package dependencies, then comparing environments pairwise with conda compare and parsing the results, but this would be quite a dirty solution. I imagine something like a command or package doing so. Tried to look out in conda docs, but found nothing.


问:
what's the diffrence bettwen go/token and token in go/src/cmd/compile/internal/syntax
They are very similar.And there's more: scanner,parser.Why are they similar but difference.

go/scanner like this:

```<code>func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
scanAgain:
    s.skipWhitespace()

    // current token start
    pos = s.file.Pos(s.offset)

    // determine token value
    insertSemi := false
    switch ch := s.ch; {
    case isLetter(ch):
        lit = s.scanIdentifier()
        if len(lit) > 1 {
            // keywords are longer than one letter - avoid lookup otherwise
            tok = token.Lookup(lit)
            switch tok {
            case token.IDENT, token.BREAK, token.CONTINUE, token.FALLTHROUGH, token.RETURN:
                insertSemi = true
            }
        }
</code>```

scanner in cmd like this:

```<code>func (s *scanner) next() {
    nlsemi := s.nlsemi
    s.nlsemi = false

redo:
    // skip white space
    s.stop()
    startLine, startCol := s.pos()
    for s.ch == ' ' || s.ch == '\t' || s.ch == '\n' && !nlsemi || s.ch == '\r' {
        s.nextch()
    }

    // token start
    s.line, s.col = s.pos()
    s.blank = s.line > startLine || startCol == colbase
    s.start()
    if isLetter(s.ch) || s.ch >= utf8.RuneSelf && s.atIdentChar(true) {
        s.nextch()
        s.ident()
        return
    }
</code>```

I think they sould be same,what's the point of this?

Body:
They are very similar.And there's more: scanner,parser.Why are they similar but difference.

go/scanner like this:

func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
scanAgain:
    s.skipWhitespace()

    // current token start
    pos = s.file.Pos(s.offset)

    // determine token value
    insertSemi := false
    switch ch := s.ch; {
    case isLetter(ch):
        lit = s.scanIdentifier()
        if len(lit) > 1 {
            // keywords are longer than one letter - avoid lookup otherwise
            tok = token.Lookup(lit)
            switch tok {
            case token.IDENT, token.BREAK, token.CONTINUE, token.FALLTHROUGH, token.RETURN:
                insertSemi = true
            }
        }

scanner in cmd like this:

func (s *scanner) next() {
    nlsemi := s.nlsemi
    s.nlsemi = false

redo:
    // skip white space
    s.stop()
    startLine, startCol := s.pos()
    for s.ch == ' ' || s.ch == '\t' || s.ch == '\n' && !nlsemi || s.ch == '\r' {
        s.nextch()
    }

    // token start
    s.line, s.col = s.pos()
    s.blank = s.line > startLine || startCol == colbase
    s.start()
    if isLetter(s.ch) || s.ch >= utf8.RuneSelf && s.atIdentChar(true) {
        s.nextch()
        s.ident()
        return
    }

I think they sould be same,what's the point of this?


问:
Keycloak javascript adapter integration with Oracle ADF application
I can't get working keycloak javascript adapter with oracle ADF application.

Keycloak adapter redirects me to the login page where I enter credentials and then redirects me back to my oracle adf application which creates infinite reload URL resulting in Internal server error by keycloak

Here is example dummy code

```<code><?xml version='1.0' encoding='UTF-8'?>
</code>```
```<code><f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"><af:document title="untitled1.jsf" id="d1">
</code>```
```<code><af:panelGroupLayout id="pgl1" layout="vertical"><script src="keycloak.js"></script><script type="text/javascript">
let kc = new Keycloak('keycloak.json');
kc.init({pkceMethod: "S256"}).then(function(authenticated) {if (authenticated) {updateToken();} else {login()}})
</code>```
```<code>        function login() {
            kc.login().then(function(res) {
                console.log(res)
            })
        }

        function updateToken() {
            kc.updateToken().then(function() {
                // we have token
            }).catch(function(err) {alert(err)})
        }

</script>
</code>```
```<code></af:panelGroupLayout>
</code>```
```<code></af:document>
</code>```
```<code></f:view>
</code>```

Steps done:
Implemented javascript adapter
Redirected to keycloak login page
Returned to my ADF application
Infinite reload

Body:
I can't get working keycloak javascript adapter with oracle ADF application.

Keycloak adapter redirects me to the login page where I enter credentials and then redirects me back to my oracle adf application which creates infinite reload URL resulting in Internal server error by keycloak

Here is example dummy code

<?xml version='1.0' encoding='UTF-8'?>

<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"><af:document title="untitled1.jsf" id="d1">

<af:panelGroupLayout id="pgl1" layout="vertical">

</af:panelGroupLayout>

</af:document>

</f:view>

Steps done:
Implemented javascript adapter
Redirected to keycloak login page
Returned to my ADF application
Infinite reload


问:
Split list of dict and saving to multiple parquets with python
I have a bunch of json files with a list of dict in them:

```<code>[
{'a': 5.523275199811905e-05, 'b': 0.0016375015413388609, 'c': -0.0166875154286623,        'd': -0.06936456641533968, 'e': -0.06665282790239256, 'f': -0.13665749109868952, 'g':   1670519207414, 'h': 1670519204046, 'y': ''}
{'a': 5.523275199811905e-05, 'b': 0.0016375015413388609, 'c': -0.0166875154286623,   'd': -0.06936456641533968, 'e': -0.06665282790239256, 'f': -0.13665749109868952, 'g':   1670519207414, 'h': 1670519204046, 'y': ''}
]
</code>```

Splitting the dict up and save them each to a separate csv file, was successful but I need to have parquet files - each for a dataset. Is there a way to solve this without spark?

I received a parquet file with partitioning but this is not what i need actually.

```<code>table_from_pandas = pa.Table.from_pandas(df)
pq.write_to_dataset(table_from_pandas,
                    root_path='ddp_final/handytracking.parquet',
                    partition_cols=['timestamp']
                   )
</code>```

Body:
I have a bunch of json files with a list of dict in them:

[
{'a': 5.523275199811905e-05, 'b': 0.0016375015413388609, 'c': -0.0166875154286623,        'd': -0.06936456641533968, 'e': -0.06665282790239256, 'f': -0.13665749109868952, 'g':   1670519207414, 'h': 1670519204046, 'y': ''}
{'a': 5.523275199811905e-05, 'b': 0.0016375015413388609, 'c': -0.0166875154286623,   'd': -0.06936456641533968, 'e': -0.06665282790239256, 'f': -0.13665749109868952, 'g':   1670519207414, 'h': 1670519204046, 'y': ''}
]

Splitting the dict up and save them each to a separate csv file, was successful but I need to have parquet files - each for a dataset. Is there a way to solve this without spark?

I received a parquet file with partitioning but this is not what i need actually.

table_from_pandas = pa.Table.from_pandas(df)
pq.write_to_dataset(table_from_pandas,
                    root_path='ddp_final/handytracking.parquet',
                    partition_cols=['timestamp']
                   )


问:
I am not getting any result when addend a variable
My dataset, Despesa_2021_Red, is the following (I just copy a small sample):

```<code>structure(list(grup_CNAE_Red = structure(c(4L, 4L, 4L, 4L, 8L,
11L, 12L, 1L, 1L, 1L, 1L), .Label = c("Aliments i begudes no alcohòliques",
"Begudes alcohòliques i tabac", "Vestit i calçat", "Habitatge",
"Mobles i parament de la llar", "Salut", "Transport", "Comunicacions",
"Oci i cultura", "Educació", "Restaurants i hotels", "Altres béns i serveis"
), class = "factor"), despesatotal = structure(c(57629.21, 186827.47,
210879.71, 105439.85, 91381.21, 344980.45, 117155.39, 44334.78,
426350.53, 199874.51, 41750.52), format.stata = "%12.0g"), despesamonetaria = structure(c(57629.21,
186827.47, 210879.71, 105439.85, 91381.21, 344980.45, 117155.39,
44334.78, 426350.53, 199874.51, 41750.52), format.stata = "%12.0g")), row.names = c(NA,
-11L), class = c("tbl_df", "tbl", "data.frame"))
</code>```

My code is such:

```<code>despesatotal_llar <- Despesa_2021_Red %>%
  select("grup_CNAE_Red", "despesatotal", "despesamonetaria") %>%
  group_by(grup_CNAE_Red) %>%
  mutate(despesatotal = sum(despesatotal)) %>%
  mutate(despesamonetaria=sum(despesamonetaria)) %>%
  summarise_if(is.numeric, sum, na.rm=TRUE) %>%
  adorn_totals("row")%>%
  mutate(proporcio_total=(despesatotal/last(despesatotal))*100)%>%
  mutate(proporcio_monetaria=(despesamonetaria/last(despesamonetaria))*100)
</code>```

And I am getting the following:

```<code>structure(list(grup_CNAE_Red = c("Aliments i begudes no alcohòliques",
"Begudes alcohòliques i tabac", "Vestit i calçat", "Habitatge",
"Mobles i parament de la llar", "Salut", "Transport", "Comunicacions",
"Oci i cultura", "Educació", "Restaurants i hotels", "Altres béns i serveis"
), despesatotal = c(72550491701696000, 514691112000324, 853338207044935,
26964294577958360, 1948071319668620, 816954427256048, 3759365484618088,
566787384086023, 1978802503248884, 122472236797361, 1603169228759177,
4471711267049114), despesamonetaria = c(71922177505370160, 514060934967651,
852780110238510, 9150794396419362, 1946413539609788, 816837090808086,
3753590662112487, 565752314409180, 1978515407744175, 120444283968143,
0, 4440563217947374)), row.names = c(NA, -12L), class = c("tabyl",
"tbl_df", "tbl", "data.frame"), core = structure(list(grup_CNAE_Red = structure(1:12, .Label = c("Aliments i begudes no alcohòliques",
"Begudes alcohòliques i tabac", "Vestit i calçat", "Habitatge",
"Mobles i parament de la llar", "Salut", "Transport", "Comunicacions",
"Oci i cultura", "Educació", "Restaurants i hotels", "Altres béns i serveis"
), class = "factor"), despesatotal = c(72550491701696000, 514691112000324,
853338207044935, 26964294577958360, 1948071319668620, 816954427256048,
3759365484618088, 566787384086023, 1978802503248884, 122472236797361,
1603169228759177, 4471711267049114), despesamonetaria = c(71922177505370160,
514060934967651, 852780110238510, 9150794396419362, 1946413539609788,
816837090808086, 3753590662112487, 565752314409180, 1978515407744175,
120444283968143, 0, 4440563217947374)), row.names = c(NA, -12L
), class = "data.frame"), tabyl_type = "two_way", totals = "row")
</code>```

So the issue is that row number 11 Resutarants i hotels
& column number 3 despesamonetaria has a result of 0 but it's actually not 0.

I do not know where the error is coming from, as the other results are all correct.

Body:
My dataset, Despesa_2021_Red, is the following (I just copy a small sample):

structure(list(grup_CNAE_Red = structure(c(4L, 4L, 4L, 4L, 8L,
11L, 12L, 1L, 1L, 1L, 1L), .Label = c("Aliments i begudes no alcohòliques",
"Begudes alcohòliques i tabac", "Vestit i calçat", "Habitatge",
"Mobles i parament de la llar", "Salut", "Transport", "Comunicacions",
"Oci i cultura", "Educació", "Restaurants i hotels", "Altres béns i serveis"
), class = "factor"), despesatotal = structure(c(57629.21, 186827.47,
210879.71, 105439.85, 91381.21, 344980.45, 117155.39, 44334.78,
426350.53, 199874.51, 41750.52), format.stata = "%12.0g"), despesamonetaria = structure(c(57629.21,
186827.47, 210879.71, 105439.85, 91381.21, 344980.45, 117155.39,
44334.78, 426350.53, 199874.51, 41750.52), format.stata = "%12.0g")), row.names = c(NA,
-11L), class = c("tbl_df", "tbl", "data.frame"))

My code is such:

despesatotal_llar <- Despesa_2021_Red %>%
  select("grup_CNAE_Red", "despesatotal", "despesamonetaria") %>%
  group_by(grup_CNAE_Red) %>%
  mutate(despesatotal = sum(despesatotal)) %>%
  mutate(despesamonetaria=sum(despesamonetaria)) %>%
  summarise_if(is.numeric, sum, na.rm=TRUE) %>%
  adorn_totals("row")%>%
  mutate(proporcio_total=(despesatotal/last(despesatotal))*100)%>%
  mutate(proporcio_monetaria=(despesamonetaria/last(despesamonetaria))*100)

And I am getting the following:

structure(list(grup_CNAE_Red = c("Aliments i begudes no alcohòliques",
"Begudes alcohòliques i tabac", "Vestit i calçat", "Habitatge",
"Mobles i parament de la llar", "Salut", "Transport", "Comunicacions",
"Oci i cultura", "Educació", "Restaurants i hotels", "Altres béns i serveis"
), despesatotal = c(72550491701696000, 514691112000324, 853338207044935,
26964294577958360, 1948071319668620, 816954427256048, 3759365484618088,
566787384086023, 1978802503248884, 122472236797361, 1603169228759177,
4471711267049114), despesamonetaria = c(71922177505370160, 514060934967651,
852780110238510, 9150794396419362, 1946413539609788, 816837090808086,
3753590662112487, 565752314409180, 1978515407744175, 120444283968143,
0, 4440563217947374)), row.names = c(NA, -12L), class = c("tabyl",
"tbl_df", "tbl", "data.frame"), core = structure(list(grup_CNAE_Red = structure(1:12, .Label = c("Aliments i begudes no alcohòliques",
"Begudes alcohòliques i tabac", "Vestit i calçat", "Habitatge",
"Mobles i parament de la llar", "Salut", "Transport", "Comunicacions",
"Oci i cultura", "Educació", "Restaurants i hotels", "Altres béns i serveis"
), class = "factor"), despesatotal = c(72550491701696000, 514691112000324,
853338207044935, 26964294577958360, 1948071319668620, 816954427256048,
3759365484618088, 566787384086023, 1978802503248884, 122472236797361,
1603169228759177, 4471711267049114), despesamonetaria = c(71922177505370160,
514060934967651, 852780110238510, 9150794396419362, 1946413539609788,
816837090808086, 3753590662112487, 565752314409180, 1978515407744175,
120444283968143, 0, 4440563217947374)), row.names = c(NA, -12L
), class = "data.frame"), tabyl_type = "two_way", totals = "row")

So the issue is that row number 11 Resutarants i hotels
& column number 3 despesamonetaria has a result of 0 but it's actually not 0.

I do not know where the error is coming from, as the other results are all correct.


问:
How to apply conv1d to timeseries data
I have the data of shape (32, 10, 140), where 32 is batch_size, 10 is time window and 140 is feature dimensions. I want to apply conv1d only on features across all time dimensionns. How to do it using keras?</p>

Title: How to apply conv1d to timeseries data


问:
Excel to calculate account balance, adding compounding daily interest
I need Excel to automatically calculate the daily interest on an amount (which will go up and down with deposits and withdrawals), and then add it to the balance total, to display the overall total including interest (compounding). This will change daily when someone looks at the value in Excel due to the daily interest being added.

For example. I have $5000. At 5% APR, the daily interest rate would be .0137%. The day after the $5000 is there, the new total should show $5000.68 if I opened and looked at the spreadsheet. Then on day 2, the total should show $5001.37. If I added $5000 more to the total on day 2 (after interest was added) I would then have $10001.37 and the interest rate for the next day should automatically add on to the new total, compounding daily.

Sample spreadsheet with accurate balance, manually calculated

Essentially, I need a spreadsheet that can display the overall balance in an account which compounds daily, allowing withdrawals and deposits at anytime [Cell H2].

How do I accomplish this!? Thank you so much for the help!


问:
Cannot resolve symbol 'github' from Dotenv dependency in maven
I'm getting the following error when trying to use the Dotenv dependency

Cannot resolve symbol 'github'

I get the error above in this line of code:
Java class

import io.github.cdimascio.dotenv.Dotenv;

pom.xml

```<code><dependency>
    <groupId>io.github.cdimascio</groupId>
    <artifactId>java-dotenv</artifactId>
    <version>5.2.2</version>
</dependency>
</code>```

In my terminal I ran:

mvn package

mvn dependency:resolve

mvn clean install

I was following these tutorials:

https://www.youtube.com/watch?v=o1HsGbTZObQ

https://www.twilio.com/blog/working-with-environment-variables-in-java

https://github.com/cdimascio/dotenv-java

pom.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>PayPalService</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>PayPalService</name>
    <description>PayPal Service project for Spring Boot</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.github.cdimascio</groupId>
            <artifactId>java-dotenv</artifactId>
            <version>5.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20220924</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>
</code>```

I'm new to Java and Maven and based on my small knowledge those commands above should help me install dependencies. Am I missing something?

Body:
I'm getting the following error when trying to use the Dotenv dependency

Cannot resolve symbol 'github'

I get the error above in this line of code:
Java class

import io.github.cdimascio.dotenv.Dotenv;

pom.xml

<dependency>
    <groupId>io.github.cdimascio</groupId>
    <artifactId>java-dotenv</artifactId>
    <version>5.2.2</version>
</dependency>

In my terminal I ran:

mvn package

mvn dependency:resolve

mvn clean install

I was following these tutorials:

https://www.youtube.com/watch?v=o1HsGbTZObQ

https://www.twilio.com/blog/working-with-environment-variables-in-java

https://github.com/cdimascio/dotenv-java

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath/>
    </parent>
    <groupId>com.example</groupId>
    <artifactId>PayPalService</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>PayPalService</name>
    <description>PayPal Service project for Spring Boot</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.github.cdimascio</groupId>
            <artifactId>java-dotenv</artifactId>
            <version>5.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20220924</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

I'm new to Java and Maven and based on my small knowledge those commands above should help me install dependencies. Am I missing something?


问:
Automotive content in pane template renders twice
I am developing an Android Automotive application and I'm just getting familiar with Templates.

I use a pane-template as the landing-page of the application. I use ScreenManager.push() to navigate to the next page when the user clicks a button. On the next screen I use Action.Back as header action. When I click the back-button the landing-page is rendered twice.

Relevant code from LandingPage:

```<code>
class LandingPageScreen(carContext: CarContext) : Screen(carContext) {

    var paneBuilder = Pane.Builder()

    override fun onGetTemplate(): Template {

        fun createAgreement() {
            screenManager.push(HomeScreen(carContext))
        }

        fun goToCalculator() {
            screenManager.push(HomeScreen(carContext))
        }
        Log.d("screenManager.stackSize", screenManager.stackSize.toString())

        val goToCalculatorActionBuilder = Action.Builder()
            .setTitle("Go to new page")
            .setOnClickListener { goToCalculator() }
            .build()

        val textRow = Row.Builder()
            .setTitle("Title")
            .addText("This field will contain some text.")
            .build()

        paneBuilder
            .addRow(textRow)
            //.addAction(createAgreementActionBuilder)
            .addAction(goToCalculatorActionBuilder)

        return PaneTemplate.Builder(paneBuilder.build())
            .setTitle("Page title")
            .setHeaderAction(Action.APP_ICON)
            .build()
    }

}
</code>```

Relevant code from HomeScreen:

```<code>class HomeScreen(carContext: CarContext) : Screen(carContext) {

    override fun onGetTemplate(): Template {
        Log.d("screenManager.stackSize", screenManager.stackSize.toString())

        return SearchTemplate.Builder(
            object : SearchCallback {
                ....
            })
            .setShowKeyboardByDefault(true)
            .setItemList(mItemList!!)
            .setHeaderAction(Action.BACK)
            .build()

    }

</code>```

When I log screenManager.stackSize, I get 1 the first render of LandingPage, 2 when I am forwarded to HomeScreen, and 1 again when I go back to LandingPage.

What am I doing wrong? Is there a lifecycle issue or something? I don't understand why it renders two times when I use Action.Back. I have used screenManager.push and Action.Back before without this problem.

Body:
I am developing an Android Automotive application and I'm just getting familiar with Templates.

I use a pane-template as the landing-page of the application. I use ScreenManager.push() to navigate to the next page when the user clicks a button. On the next screen I use Action.Back as header action. When I click the back-button the landing-page is rendered twice.

Relevant code from LandingPage:

class LandingPageScreen(carContext: CarContext) : Screen(carContext) {

    var paneBuilder = Pane.Builder()

    override fun onGetTemplate(): Template {

        fun createAgreement() {
            screenManager.push(HomeScreen(carContext))
        }

        fun goToCalculator() {
            screenManager.push(HomeScreen(carContext))
        }
        Log.d("screenManager.stackSize", screenManager.stackSize.toString())

        val goToCalculatorActionBuilder = Action.Builder()
            .setTitle("Go to new page")
            .setOnClickListener { goToCalculator() }
            .build()

        val textRow = Row.Builder()
            .setTitle("Title")
            .addText("This field will contain some text.")
            .build()

        paneBuilder
            .addRow(textRow)
            //.addAction(createAgreementActionBuilder)
            .addAction(goToCalculatorActionBuilder)

        return PaneTemplate.Builder(paneBuilder.build())
            .setTitle("Page title")
            .setHeaderAction(Action.APP_ICON)
            .build()
    }

}

Relevant code from HomeScreen:

class HomeScreen(carContext: CarContext) : Screen(carContext) {

    override fun onGetTemplate(): Template {
        Log.d("screenManager.stackSize", screenManager.stackSize.toString())

        return SearchTemplate.Builder(
            object : SearchCallback {
                ....
            })
            .setShowKeyboardByDefault(true)
            .setItemList(mItemList!!)
            .setHeaderAction(Action.BACK)
            .build()

    }

When I log screenManager.stackSize, I get 1 the first render of LandingPage, 2 when I am forwarded to HomeScreen, and 1 again when I go back to LandingPage.

What am I doing wrong? Is there a lifecycle issue or something? I don't understand why it renders two times when I use Action.Back. I have used screenManager.push and Action.Back before without this problem.


问:
How can I get any/all the Dataverse table relationship behavior and actions? through SQL query or any export mechanism
In dataverse table relations, I wants to get all the relationship behavioral types for all the table relations.

In the above image, I had shown the one relationship behavioral actions and I wanted to query (SQL query) or any export mechanism to get the entire relationship behavioral actions(specially delete action) for contact table. is it possible to get?

ex.

name
relationship type
type
 action
 behavior

contact_customer_accounts
         Many-to-one
         Parential
           delete
        cascade all

contact_customer_contacts
         Many-to-one
        System
              delete
       Remove Link


问:
Can't create a view in sqlalchemy / FastAPI
I am trying to create a view in my FastAPI application using sqlalchemy. I don't understand why the view is not being created.

Here is the code that defines the view:

```<code>class AllTablesView(Base):
    companies = Table("companies", Base.metadata, autoload=True, autoload_with=engine)
    managers = Table("managers", Base.metadata, autoload=True, autoload_with=engine)
    buildings = Table("buildings", Base.metadata, autoload=True, autoload_with=engine)
    devices = Table("devices", Base.metadata, autoload=True, autoload_with=engine)

    __table__ = (select([companies.c.id, companies.c.name, companies.c.address, companies.c.phone, companies.c.email,
                         managers.c.idp_id, managers.c.preferences, managers.c.permissions,
                         buildings.c.name, buildings.c.address,
                         devices.c.name, devices.c.type])
                 .select_from(companies.outerjoin(managers, managers.c.company_id == companies.c.id)
                              .outerjoin(buildings, buildings.c.company_id == companies.c.id)
                              .outerjoin(devices, devices.c.building_id == buildings.c.id))
                 .alias())

    __table_args__ = {"extend_existing": True, "view_name": "all_tables_view"}
</code>```

I printed the table attribute and it is generating SQL correctly:

```<code>2022-12-15 09:17:14.292 | INFO     | app.main:startup_event:38 - SELECT companies.id, companies.name, companies.address, companies.phone, companies.email, managers.idp_id, managers.preferences, managers.permissions, buildings.name AS name_1, buildings.address AS address_1, devices.name AS name_2, devices.type
FROM companies LEFT OUTER JOIN managers ON managers.company_id = companies.id LEFT OUTER JOIN buildings ON buildings.company_id = companies.id LEFT OUTER JOIN devices ON devices.building_id = buildings.id
</code>```

If needed, here is the repository of the application: https://github.com/seccom-cctv/sites-management-api/blob/main/app/config/database.py

Body:
I am trying to create a view in my FastAPI application using sqlalchemy. I don't understand why the view is not being created.

Here is the code that defines the view:

class AllTablesView(Base):
    companies = Table("companies", Base.metadata, autoload=True, autoload_with=engine)
    managers = Table("managers", Base.metadata, autoload=True, autoload_with=engine)
    buildings = Table("buildings", Base.metadata, autoload=True, autoload_with=engine)
    devices = Table("devices", Base.metadata, autoload=True, autoload_with=engine)

    __table__ = (select([companies.c.id, companies.c.name, companies.c.address, companies.c.phone, companies.c.email,
                         managers.c.idp_id, managers.c.preferences, managers.c.permissions,
                         buildings.c.name, buildings.c.address,
                         devices.c.name, devices.c.type])
                 .select_from(companies.outerjoin(managers, managers.c.company_id == companies.c.id)
                              .outerjoin(buildings, buildings.c.company_id == companies.c.id)
                              .outerjoin(devices, devices.c.building_id == buildings.c.id))
                 .alias())

    __table_args__ = {"extend_existing": True, "view_name": "all_tables_view"}

I printed the table attribute and it is generating SQL correctly:

2022-12-15 09:17:14.292 | INFO     | app.main:startup_event:38 - SELECT companies.id, companies.name, companies.address, companies.phone, companies.email, managers.idp_id, managers.preferences, managers.permissions, buildings.name AS name_1, buildings.address AS address_1, devices.name AS name_2, devices.type
FROM companies LEFT OUTER JOIN managers ON managers.company_id = companies.id LEFT OUTER JOIN buildings ON buildings.company_id = companies.id LEFT OUTER JOIN devices ON devices.building_id = buildings.id

If needed, here is the repository of the application: https://github.com/seccom-cctv/sites-management-api/blob/main/app/config/database.py


问:
How to retrieve nested data from addSuccessListener firebase
I'm Firebase new here and I'm trying to retrieve the nested data from firebase. I have spent the whole day but can't deal with it.

this is my object structures

```<code>data class Punch(
  var roundID: Int = 0,
  var isCorrect: Boolean = true,
  var speed: Double = 0.0
)

data class Training(
  var sessionID: String = "",
  var userId: String = "",
  var username: String = "",
  var date: Date = Date(),
  var round_Sessions: MutableList<RoundInfor>
)

data class RoundInfor(
  var roundID: String = "",
  var round_length: Double = 0.0,
  var total_punches: Int = 0,
  var correct_punches: Int = 0,
  var incorrect_punches: Int = 0,
  var avg_heart_rate: Double = 0.0,
  var avg_speed: Double = 0.0,
  var punches: MutableList<Punch>
)
</code>```

My data structure

For example: I'm trying to save data from round_Sessions and punches. How could I dig into this?

Body:
I'm Firebase new here and I'm trying to retrieve the nested data from firebase. I have spent the whole day but can't deal with it.

this is my object structures

data class Punch(
  var roundID: Int = 0,
  var isCorrect: Boolean = true,
  var speed: Double = 0.0
)

data class Training(
  var sessionID: String = "",
  var userId: String = "",
  var username: String = "",
  var date: Date = Date(),
  var round_Sessions: MutableList<RoundInfor>
)

data class RoundInfor(
  var roundID: String = "",
  var round_length: Double = 0.0,
  var total_punches: Int = 0,
  var correct_punches: Int = 0,
  var incorrect_punches: Int = 0,
  var avg_heart_rate: Double = 0.0,
  var avg_speed: Double = 0.0,
  var punches: MutableList<Punch>
)

My data structure

For example: I'm trying to save data from round_Sessions and punches. How could I dig into this?


问:
Instructions frame for adjust skip
I am using Instructions for app walk-through.

Trying to adjust skip alignment since its overlaps the UIButton at view point, as shown in below image.

How to adjust the skip to bottom-center of screen?

CocoaPods: https://cocoapods.org/pods/Instructions

Here is code.

```<code>func coachMarkSetup(){
    self.coachMarksController.dataSource = self
    let skipView = CoachMarkSkipDefaultView()
    skipView.titleLabel?.font = UIFont(font: Font.interMedium, size: 14)
    skipView.setTitle("Skip", for: .normal)
    skipView.layer.cornerRadius = 17
    skipView.titleLabel?.layer.cornerRadius = 17

    skipView.titleLabel?.textColor =  UIColor.init(named: ColorPalette.gray700Color)
    skipView.backgroundColor =  UIColor.init(named: ColorPalette.gray300Color)
    skipView.layer.backgroundColor = UIColor(named: ColorPalette.gray300Color)?.cgColor

    self.coachMarksController.overlay.backgroundColor =  UIColor.init(named: ColorPalette.grayOpacity) ?? .lightGray
    self.coachMarksController.skipView = skipView
    self.coachMarksController.skipView?.backgroundColor = UIColor.init(named: ColorPalette.gray300Color)
    self.coachMarksController.skipView?.translatesAutoresizingMaskIntoConstraints = false

}
</code>```

Title: Instructions frame for adjust skip

Body:
I am using Instructions for app walk-through.

Trying to adjust skip alignment since its overlaps the UIButton at view point, as shown in below image.

How to adjust the skip to bottom-center of screen?

CocoaPods: https://cocoapods.org/pods/Instructions

Here is code.

func coachMarkSetup(){
    self.coachMarksController.dataSource = self
    let skipView = CoachMarkSkipDefaultView()
    skipView.titleLabel?.font = UIFont(font: Font.interMedium, size: 14)
    skipView.setTitle("Skip", for: .normal)
    skipView.layer.cornerRadius = 17
    skipView.titleLabel?.layer.cornerRadius = 17

    skipView.titleLabel?.textColor =  UIColor.init(named: ColorPalette.gray700Color)
    skipView.backgroundColor =  UIColor.init(named: ColorPalette.gray300Color)
    skipView.layer.backgroundColor = UIColor(named: ColorPalette.gray300Color)?.cgColor

    self.coachMarksController.overlay.backgroundColor =  UIColor.init(named: ColorPalette.grayOpacity) ?? .lightGray
    self.coachMarksController.skipView = skipView
    self.coachMarksController.skipView?.backgroundColor = UIColor.init(named: ColorPalette.gray300Color)
    self.coachMarksController.skipView?.translatesAutoresizingMaskIntoConstraints = false

}


问:
System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name' + _ViewStart.cshtml + Razor + C#.Net

Error in _ViewStart.cshtml with DotRez Razor

Steps

I'm trying debug my app (with IIS Express or IIS) but appear error of ArgumentNullException, but if I open de app only with IIS without attach the app, it open correctly.

Exception

System.ArgumentNullException: 'Value cannot be null.
Arg_ParamName_Name'

I want to debug my app and I don't have any idea of what is the problem.
I have Windows 10 and run with Visual Studio 2022 Professional


问:
is there a way to convert a yolov5 dataset for rcnn or a mask-rcnn?
I currently got a yolov5 dataset , with everything on it (labels in form of : label , x , y , widh , height).

My question is , is there an fast way to convert it into a proper custom dataset for mask-rcnn?

Im currently searching the whole web, otherwise i have to make a custom dataset from scratch with about 1000 pictures and i sadly i got limited time.

Otherwise i would sit down and use this guide: https://engineering.matterport.com/splash-of-color-instance-segmentation-with-mask-r-cnn-and-tensorflow-7c761e238b46


问:
Noise on car in Unreal Engine 5 exported build package game and Low Fps
Default Vehicle Template of Unreal Engine 5 exported package build game

I just created new project using default vehicle template of unreal engine 5.1 and exported package build of the template as a game but there is some kind of noise on the car I don't know why and the fps are too low it is nothing but default package. I was expecting over 100 FPS but there are only 40 to 45 and occasionally 30 too. what am I doing wrong here?
It is my first time using unreal engine. I am switching from unity after 2 years and it is my first posted question here on stack overflow so, please don't mind my silly mistakes.


问:
Reorder and calculate values from Excel
In order to learn Python I launched myself in the realization of a project and I now find myself stuck.
What I managed to far is to read different excel files with data from 5 different years contained in one Excel file pro year and copy them into a single Excel file in different sheets (1976, 1982, 1999, 2009 and 2019 in this case). Also, I managed to extract the value of “Gewiss” (some form of address) from all the tables and create a list of all the unique values of “Gewiss” into a new sheet (“Raw”).
I’ve been using a wild mix of numpy and openpyxl and I am now unsure how to go foreward. What I obtained so far, is the “Data” sheet. This contains all the values of “Gewiss”, “Sohlenbreite”, “mittl_Sohle” and “Year” where “Year” are the last four digits of “Auf_Dat” but it doesn’t help me much.

My goal is to select the data from the “year”-sheets and copy some of them into the list of unique Gewiss Adresses in “Raw”-sheet at the correct place (at the same Gewiss Adress) and to calculate the deltas between years.

The list of Gewiss in the Raw sheet contains all the Gewiss included in the different excel tables but not every table contains necessarily every Gewiss so the number of elements is not necessarily the same.
I need to do so that it works for different data-sets of excel tables (different number of tables and different years) but the data-structure of the start excel tables is fix.
Can someone please advise me a procedure/tool/workflow?

Thank you

Title: Reorder and calculate values from Excel


问:
Add expiry date for token with laravel sanctum (expiration - expires_at ) (solved)
```<code>use Illuminate\Support\Facades\Date;

$expiresAt = Date::now()->addMinutes(5);
$token = $user->createToken('token name', ['server:update'], $expiresAt)->plainTextToken;
</code>```

if you want to add expiry time for a token you can do it like this

Body:
use Illuminate\Support\Facades\Date;

$expiresAt = Date::now()->addMinutes(5);
$token = $user->createToken('token name', ['server:update'], $expiresAt)->plainTextToken;

if you want to add expiry time for a token you can do it like this


问:
Using passport for socket.io
Hi im trying to use passport for authencication, But im not sure what to do on the client side. I think the server side is fine, but it gives me this error:failed: WebSocket is closed before the connection is established. So it seems like it cant get the connection. what do i need to send from the client side, and do i need to change something on server side??
please heeeelp thanks:)

server.js

```<code>
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require("socket.io")(server, {
  cors: {
    origin: "*",
    methods: ["GET", "POST"]
  }
});
var port = process.env.PORT || 4000;
const passportSocketIo = require('passport.socketio')
const cookieParser = require('cookie-parser')

const session = require("express-session")
const passport = require('passport')

io.use(passportSocketIo.authorize({
  cookieParser: cookieParser,
  key:          'express.sid',
  secret:       'session_secret',
  store:        session,
  success:      onAuthorizeSuccess,
  fail:         onAuthorizeFail,
}));

function onAuthorizeSuccess(data, accept){
  console.log('successful connection to socket.io');

  // The accept-callback still allows us to decide whether to
  // accept the connection or not.
  accept(null, true);

  // OR

  // If you use socket.io@1.X the callback looks different
  accept();
}

function onAuthorizeFail(data, message, error, accept){
  if(error)
    throw new Error(message);
  console.log('failed connection to socket.io:', message);

  // We use this callback to log all of our failed connections.
  accept(null, false);

  // OR

  // If you use socket.io@1.X the callback looks different
  // If you don't want to accept the connection
  if(error)
    accept(new Error(message));
  // this error will be sent to the user as a special error-package
  // see: http://socket.io/docs/client-api/#socket > error-object
}

io.on('connection', function (socket) {

  console.log("connection")
  var addedUser = false;

  // when the client emits 'new message', this listens and executes
  socket.on('new message', function (data) {
    var data = validator.escape(data);
    // we tell the client to execute 'new message'
    socket.broadcast.emit('new message', {
      username: socket.username,
      message: data
    });
    db.serialize(function() {
      // console.log('inserting message to database');
      var insertMessageStr = "INSERT INTO messages (username, content, posted) VALUES ('" + socket.username + "','" + data.toString() + "'," + Date.now() + ");"
      // console.log(insertMessageStr)
      db.run(insertMessageStr);
    });
  });

</code>```

client.js

```<code>  const socket = io({
      key:          'express.sid',
      secret:       'session_secret',
    });

</code>```

Title: Using passport for socket.io

Body:
Hi im trying to use passport for authencication, But im not sure what to do on the client side. I think the server side is fine, but it gives me this error:failed: WebSocket is closed before the connection is established. So it seems like it cant get the connection. what do i need to send from the client side, and do i need to change something on server side??
please heeeelp thanks:)

server.js

var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require("socket.io")(server, {
  cors: {
    origin: "*",
    methods: ["GET", "POST"]
  }
});
var port = process.env.PORT || 4000;
const passportSocketIo = require('passport.socketio')
const cookieParser = require('cookie-parser')

const session = require("express-session")
const passport = require('passport')

io.use(passportSocketIo.authorize({
  cookieParser: cookieParser,
  key:          'express.sid',
  secret:       'session_secret',
  store:        session,
  success:      onAuthorizeSuccess,
  fail:         onAuthorizeFail,
}));

function onAuthorizeSuccess(data, accept){
  console.log('successful connection to socket.io');

  // The accept-callback still allows us to decide whether to
  // accept the connection or not.
  accept(null, true);

  // OR

  // If you use socket.io@1.X the callback looks different
  accept();
}

function onAuthorizeFail(data, message, error, accept){
  if(error)
    throw new Error(message);
  console.log('failed connection to socket.io:', message);

  // We use this callback to log all of our failed connections.
  accept(null, false);

  // OR

  // If you use socket.io@1.X the callback looks different
  // If you don't want to accept the connection
  if(error)
    accept(new Error(message));
  // this error will be sent to the user as a special error-package
  // see: http://socket.io/docs/client-api/#socket > error-object
}

io.on('connection', function (socket) {

  console.log("connection")
  var addedUser = false;

  // when the client emits 'new message', this listens and executes
  socket.on('new message', function (data) {
    var data = validator.escape(data);
    // we tell the client to execute 'new message'
    socket.broadcast.emit('new message', {
      username: socket.username,
      message: data
    });
    db.serialize(function() {
      // console.log('inserting message to database');
      var insertMessageStr = "INSERT INTO messages (username, content, posted) VALUES ('" + socket.username + "','" + data.toString() + "'," + Date.now() + ");"
      // console.log(insertMessageStr)
      db.run(insertMessageStr);
    });
  });

client.js

  const socket = io({
      key:          'express.sid',
      secret:       'session_secret',
    });


问:
Error in `dplyr::mutate()`: when using tidysynth in R
I'm trying to do a Synthetic Control Method using 'tidysynth' and the following code:

```<code># initial the synthetic control object
require(tidysynth)
ncenso %>% dplyr::glimpse(urban_out)

urban_out <- ncenso %>%

synthetic_control(outcome = ncenso$perc_urban, # outcome
                  unit =  ncenso$region, # unit index in the panel data
                  time = ncenso$year, # time index in the panel data
                  i_unit = "antofagasta", # unit where the intervention occurred
                  i_time = 1930, # time period when the intervention occurred
                  generate_placebos = TRUE) %>%  # generate placebo synthetic controls (for inference)

  # Generate the aggregate predictors used to fit the weights
    generate_predictor(time_window = 1895:1970,
                     foreigners = mean(ncenso$perc_ext, na.rm = TRUE),
                     edu = mean(ncenso$perc_alf, na.rm = TRUE),
                     mining = mean(ncenso$perc_mine, na.rm = TRUE),
                     agriculture = mean(ncenso$perc_agri, na.rm = TRUE)) %>%

  # Generate the fitted weights for the synthetic control
   generate_weights(optimization_window = 1885:1930,
                  margin_ipop = .02,sigf_ipop = 7,bound_ipop = 6) %>%

  # Generate the synthetic control
  generate_control()
</code>```

`

But it doesn't work apparently because placebos are not being generated properly. The following error appears:

``<error/dplyr:::mutate_error> Error in dplyr::mutate(): ! Problem while computing placebo = ifelse(ncenso$region != i_unit, 1, 0). x placebo\ must be size 15 or 1, not 135.
Backtrace:

... %>% generate_control()

dplyr:::mutate.data.frame(., placebo = ifelse(!!unit != i_unit, 1, 0))``

Body:
I'm trying to do a Synthetic Control Method using 'tidysynth' and the following code:

# initial the synthetic control object
require(tidysynth)
ncenso %>% dplyr::glimpse(urban_out)

urban_out <- ncenso %>%

synthetic_control(outcome = ncenso$perc_urban, # outcome
                  unit =  ncenso$region, # unit index in the panel data
                  time = ncenso$year, # time index in the panel data
                  i_unit = "antofagasta", # unit where the intervention occurred
                  i_time = 1930, # time period when the intervention occurred
                  generate_placebos = TRUE) %>%  # generate placebo synthetic controls (for inference)

  # Generate the aggregate predictors used to fit the weights
    generate_predictor(time_window = 1895:1970,
                     foreigners = mean(ncenso$perc_ext, na.rm = TRUE),
                     edu = mean(ncenso$perc_alf, na.rm = TRUE),
                     mining = mean(ncenso$perc_mine, na.rm = TRUE),
                     agriculture = mean(ncenso$perc_agri, na.rm = TRUE)) %>%

  # Generate the fitted weights for the synthetic control
   generate_weights(optimization_window = 1885:1930,
                  margin_ipop = .02,sigf_ipop = 7,bound_ipop = 6) %>%

  # Generate the synthetic control
  generate_control()

`

But it doesn't work apparently because placebos are not being generated properly. The following error appears:

``<error/dplyr:::mutate_error> Error in dplyr::mutate(): ! Problem while computing placebo = ifelse(ncenso$region != i_unit, 1, 0). x placebo\ must be size 15 or 1, not 135.
Backtrace:

... %>% generate_control()

dplyr:::mutate.data.frame(., placebo = ifelse(!!unit != i_unit, 1, 0))``


问:
Mptt model does not return {{ children }}
I have a Deviz model that inherits from MPTTmodel. I populated the database with data but can't get to show the children.

The tree should be like this:

```<code>    Chapter 1
        -Subchapter 1
            --SubSubchapter 1
                ---Article 1
                ---Article 2
                ---Article 3
    Chapter 2
        -Subsubchapter1
            --Article 1
            --Article 2
</code>```

In the template, it only displays the Chapters.

When changing object_list to object_list.get_descendants, it does not display the first level tree (Chapters)

models.py

class Lucrare(models.Model):
        name = models.CharField(default='',max_length=100,verbose_name="Denumire")

class Deviz(MPTTModel):
    lucrare = models.ForeignKey(Lucrare, on_delete=models.CASCADE,default='',null=True,related_name="deviz")
    parent = TreeForeignKey('self', on_delete=models.CASCADE,null=True,blank=True,related_name='children')
    cod = models.CharField(default='', max_length=20,verbose_name="Cod")
    norma = models.CharField(default='',max_length=20,verbose_name="Norma")
    denumire = models.TextField(default='',verbose_name="Denumire")
    um_articol = models.TextField(default='',verbose_name="Um")
    oferta = models.FloatField(default=0,verbose_name="Cant Oferta")
    buget = models.FloatField(default=0)
    cost = models.FloatField(default=0)
    def __str__(self):
        return self.denumire
    class Meta:
        verbose_name = 'Deviz'
        verbose_name_plural = 'Devize'
```
<p><strong><code>views.py</code></strong></p>
<pre class="lang-py prettyprint-override"><code>class LucrareDetail(LoginRequiredMixin, DetailView):
    template_name = "proiecte/lucrare_detail.html"
    context_object_name = "lucrari"
    model = Lucrare
</code>```

template.html

{% recursetree object_list %}

  {{ node.denumire }}
  {% if not node.is_leaf_node %}

        {{ children }}

  {% endif %}

{% endrecursetree %}
```

Body:
I have a Deviz model that inherits from MPTTmodel. I populated the database with data but can't get to show the children.

The tree should be like this:

    Chapter 1
        -Subchapter 1
            --SubSubchapter 1
                ---Article 1
                ---Article 2
                ---Article 3
    Chapter 2
        -Subsubchapter1
            --Article 1
            --Article 2

In the template, it only displays the Chapters.

When changing object_list to object_list.get_descendants, it does not display the first level tree (Chapters)

models.py

class Lucrare(models.Model):
        name = models.CharField(default='',max_length=100,verbose_name="Denumire")

class Deviz(MPTTModel):
    lucrare = models.ForeignKey(Lucrare, on_delete=models.CASCADE,default='',null=True,related_name="deviz")
    parent = TreeForeignKey('self', on_delete=models.CASCADE,null=True,blank=True,related_name='children')
    cod = models.CharField(default='', max_length=20,verbose_name="Cod")
    norma = models.CharField(default='',max_length=20,verbose_name="Norma")
    denumire = models.TextField(default='',verbose_name="Denumire")
    um_articol = models.TextField(default='',verbose_name="Um")
    oferta = models.FloatField(default=0,verbose_name="Cant Oferta")
    buget = models.FloatField(default=0)
    cost = models.FloatField(default=0)
    def __str__(self):
        return self.denumire
    class Meta:
        verbose_name = 'Deviz'
        verbose_name_plural = 'Devize'

views.py

class LucrareDetail(LoginRequiredMixin, DetailView):
    template_name = "proiecte/lucrare_detail.html"
    context_object_name = "lucrari"
    model = Lucrare

template.html

{% recursetree object_list %}

  {{ node.denumire }}
  {% if not node.is_leaf_node %}

        {{ children }}

  {% endif %}

{% endrecursetree %}


问:
Thymeleaf-Layout-Dialect didn't decorate
I've used attritubte Decorate in Thymeleaf-Layout-Dialect to create file index2.html,the program runs normally, but it's not success to Decorate file index2.html.
Here is my code
File "Build.graddle"
`

```<code>plugins {
    id 'java'
    id 'org.springframework.boot' version '2.7.6'
    id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.0.0'
'

    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'com.mysql:mysql-connector-j'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
    useJUnitPlatform()
}

</code>```

`

File _layout.html

```<code><!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
  <title>Layout page</title>
  <script src="common-script.js"></script>
</head>
<body>
  <header>
    <h1>My website</h1>
  </header>
  <section layout:fragment="content">
    <p>Page content goes here</p>
  </section>
</body>
</html>
</code>```

File index2.html

```<code><!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorate="~{_layout.html}">
<head>
  <title>Content page</title>
  <script src="content-script.js"></script>
</head>
<body>
  <section layout:fragment="content">
    <p>This is a paragraph from the content page</p>
  </section>
</body>
</html>
</code>```

What should I do to solve this problem ? Thanks a lot

Body:
I've used attritubte Decorate in Thymeleaf-Layout-Dialect to create file index2.html,the program runs normally, but it's not success to Decorate file index2.html.
Here is my code
File "Build.graddle"
`

plugins {
    id 'java'
    id 'org.springframework.boot' version '2.7.6'
    id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.0.0'
'

    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'com.mysql:mysql-connector-j'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
    useJUnitPlatform()
}

`

File _layout.html

<!DOCTYPE html>

  <title>Layout page</title>

My website

Page content goes here

File index2.html

<!DOCTYPE html>

  <title>Content page</title>

This is a paragraph from the content page

What should I do to solve this problem ? Thanks a lot


问:
How can I create a post with Django crispy forms?
I want to add a form so users can create a new post. So I added the following code:

```<code>{% load crispy_forms_tags %}
{% block content %}
            <div class="content-section">
                <form method="POST">
                    {% csrf_token %}
                    <fieldset class="form-group">
                        <legend class="boder-bottom mb-4">Inserat erstellen</legend>
                        {{ form|crispy }}
                    </fieldset>
                    <div class="form-group">
                        <button class="btn btn-outline-info" type="submit">Post</button>
                    </div>
                </form>
            </div>
{% endblock content %}
</code>```

This is what it supposed to look like:

But this is what it end up looking like. I followed the steps from a Youtube Tutorial and the result looks different than mine. What am I'm missing ?

Body:
I want to add a form so users can create a new post. So I added the following code:

{% load crispy_forms_tags %}
{% block content %}

                <form method="POST">
                    {% csrf_token %}
                    <fieldset class="form-group">
                        <legend class="boder-bottom mb-4">Inserat erstellen</legend>
                        {{ form|crispy }}
                    </fieldset>

                        <button class="btn btn-outline-info" type="submit">Post</button>

                </form>

{% endblock content %}

This is what it supposed to look like:

But this is what it end up looking like. I followed the steps from a Youtube Tutorial and the result looks different than mine. What am I'm missing ?


问:
Apache Tika hangs forever while detecting MIME type from URL
I'm trying to detect MIME type for the resource located at: https://www.futureelectronics.com/fr/search/?text=something.

But when running this Java code based on Apache Tika detect method it never returns something:

package mypacakge;

import java.io.IOException;
import java.net.URL;
import org.apache.tika.Tika;

public class ExampleApp {

    public static void main(String[] args) throws IOException {

        URL url = new URL("https://www.futureelectronics.com/fr/search/?text=something");
        Tika tika = new Tika();
        String mimeType = tika.detect(url);
        System.out.println(mimeType);
    }

}
```
<p>By investigating the implementation of the <code>detect</code> method I saw that it relies on the <code>java.net.URLConnection</code> <code>getContentType</code> method. And this is the one that is blocking.</p>
<p>So here I have two questions:</p>
<ul>
<li>Do you have any idea why this specific URL is causing Tika <code>detect</code> to hang?</li>
<li><code>java.net.URLConnection</code> can have a read timeout configured. But from the Tika library level how can I control this read timeout configuration?</li>
</ul>
<p>My Tika version:</p>
<pre class="lang-xml prettyprint-override"><code>    <dependency>
        <groupId>org.apache.tika</groupId>
        <artifactId>tika-core</artifactId>
        <version>2.6.0</version>
    </dependency>
</code>```

Body:
I'm trying to detect MIME type for the resource located at: https://www.futureelectronics.com/fr/search/?text=something.

But when running this Java code based on Apache Tika detect method it never returns something:

package mypacakge;

import java.io.IOException;
import java.net.URL;
import org.apache.tika.Tika;

public class ExampleApp {

    public static void main(String[] args) throws IOException {

        URL url = new URL("https://www.futureelectronics.com/fr/search/?text=something");
        Tika tika = new Tika();
        String mimeType = tika.detect(url);
        System.out.println(mimeType);
    }

}

By investigating the implementation of the detect method I saw that it relies on the java.net.URLConnection getContentType method. And this is the one that is blocking.

So here I have two questions:

Do you have any idea why this specific URL is causing Tika detect to hang?

java.net.URLConnection can have a read timeout configured. But from the Tika library level how can I control this read timeout configuration?

My Tika version:

    <dependency>
        <groupId>org.apache.tika</groupId>
        <artifactId>tika-core</artifactId>
        <version>2.6.0</version>
    </dependency>


问:
Action requested: Declare your Ad ID permission but i cant An unexpected error has occurred. Please try again. (58FCB30C)
i am try to uplaode my app but

Errors, warnings and messages

Your app targets Android 13 (API 33) or above. You must declare the use of advertising ID in Play Console.

then i go to
App content -> Advertising ID

try to select No or yes alwase return

An unexpected error has occurred. Please try again. (58FCB30C)

58FCB30C

save sucssess and coutenu


问:
R: error, the condition has length>1 in if statement
I fairly new to R and I'm trying to wrap my head around this error. I've already consulted other questions regarding it and all of them imply that the error is thrown when there is a vector/list in the condition of an if statement, but that's not my case. I have only one condition:

```<code>if (dataset$scda == "I"){
    a=1
}else if (dataset$scda == "A"){
    a=2
}else{
    a=0
}

</code>```

And it throws the error

```<code>Error in if (dataset$scda == "I") { :
  the condition has length > 1
Execution halted
</code>```

I've tried to find out if the problem is caused by a vector in the condition, however, the output of

print(class(dataset$scda))
is
[1] "character"

So the standard answer I've found so far (e.g. "you have a vector in the condition") doesn't apply.

Body:
I fairly new to R and I'm trying to wrap my head around this error. I've already consulted other questions regarding it and all of them imply that the error is thrown when there is a vector/list in the condition of an if statement, but that's not my case. I have only one condition:

if (dataset$scda == "I"){
    a=1
}else if (dataset$scda == "A"){
    a=2
}else{
    a=0
}

And it throws the error

Error in if (dataset$scda == "I") { :
  the condition has length > 1
Execution halted

I've tried to find out if the problem is caused by a vector in the condition, however, the output of

print(class(dataset$scda))
is
[1] "character"

So the standard answer I've found so far (e.g. "you have a vector in the condition") doesn't apply.


问:
Preview live wallpaper preview in main activity background
I am quite new to android and java, and I would like to have a bit of help from you to figure things out.

I have been working on a live wallpaper app lately, here is what I achieved and my blocking points:

I use the WallpaperService to create my custom LWP, I change its colors and shapes based on the user preference (preference fragment screen) with preferenceChangeListener.

My main activity just handles the preference fragments and UI. Is is my main menu where I can set the WP and change the preferences.

Here is my problem: I would like to show the live wallpaper preview as background of my main activity.
I haven't figured out a way to do this so far.

The only solution I found is to show the wallpaper through the activity by changing my Theme to a transparent one.

But this requires to set the wallpaper first. Once the WP is set, my app works exactly the way I want. But before that, my main activity can't show the WP preview because the service isn't running yet.

I don't think that there's a way to extract the WP preview from the WP service. I need to change something.

Also, I don't want to show only a sample img of the WP, I really want to run my code and show the results to the user as a preview.

Could you tell me how to change my code in order to get the correct behavior? I might have to use another class that I could run in parallel or something. It is a bit obscure to me...

Thank you very much!


问:
How to use a middleware inside a controller function (Node.JS)
I would like to add a middleware that checks the object schemas of the request.body :

if the test checks, continue with the controller fonction through next()
if the test doesn't check,  continue with the error handling middleware through next(error)

The middleware works fine, however I would like to add it at the beginning of the function that needs it instead of adding it in the route for the sake of practicality and curiosity.

I'm getting the error: "Cannot set headers after they are sent to the client", while I do not use response in the middleware, I wonder if it is possible to integrate it in a function or not at all?

Many thanks !

List Controller (app/controllers/list.controller.js)

 updateListById: async function (request, response, next) {
        validateList(request.body, next);

        const { position, name } = request.body;
        const { id } = request.params;

        try {
            const list = await List.findByPk(id);
            list.name = name;
            list.position = position;
            await list.save();

            response.json(list);
        } catch (error) {
            console.trace(error);
            next(error);
        }
    },
```
<p>List Validator (app/validator/list.validator.js)</p>
<pre class="lang-js prettyprint-override"><code>const z = require("zod");
const validateData = require("../utils/validateData");

const schemaData = z.object({
    name: z.string().min(2, { message: "Le nom doit faire au moins deux caractères." }),
    position: z.number({ message: "Veuillez remplir la position." }),
});

const listValidator = {
    validateList: function (listData, next) {
        return validateData(listData, schemaData, next);
    },
};

module.exports = listValidator;

</code>```

Data Validator (app/utils/validateData.js)

function validateData(data, schema, next) {
    const z = schema.parse(data);
    if (z.errors) return next(errors);
    next();
}

module.exports = validateData;

```

Body:
I would like to add a middleware that checks the object schemas of the request.body :

if the test checks, continue with the controller fonction through next()
if the test doesn't check,  continue with the error handling middleware through next(error)

The middleware works fine, however I would like to add it at the beginning of the function that needs it instead of adding it in the route for the sake of practicality and curiosity.

I'm getting the error: "Cannot set headers after they are sent to the client", while I do not use response in the middleware, I wonder if it is possible to integrate it in a function or not at all?

Many thanks !

List Controller (app/controllers/list.controller.js)

 updateListById: async function (request, response, next) {
        validateList(request.body, next);

        const { position, name } = request.body;
        const { id } = request.params;

        try {
            const list = await List.findByPk(id);
            list.name = name;
            list.position = position;
            await list.save();

            response.json(list);
        } catch (error) {
            console.trace(error);
            next(error);
        }
    },

List Validator (app/validator/list.validator.js)

const z = require("zod");
const validateData = require("../utils/validateData");

const schemaData = z.object({
    name: z.string().min(2, { message: "Le nom doit faire au moins deux caractères." }),
    position: z.number({ message: "Veuillez remplir la position." }),
});

const listValidator = {
    validateList: function (listData, next) {
        return validateData(listData, schemaData, next);
    },
};

module.exports = listValidator;

Data Validator (app/utils/validateData.js)

function validateData(data, schema, next) {
    const z = schema.parse(data);
    if (z.errors) return next(errors);
    next();
}

module.exports = validateData;


问:
How to change password after creating user in the chain?
I am looking at the nft auction example for hyperledger fabric.  I see that when registering a user, the username and password is stored in the chaincode state.

On login, the user is retrieved from the chain and its password is checked against the supplied password.

But what if the user forgot his password.  If user change the password, do we create another user in the chaincode since that current user record is immutable?  But how to know which user record to retrieve during login?


问:
Colab unexpectedly gets stuck and hangs after executing input() function
Colab unexpectedly gets stuck and hangs after executing input() function (Python), e.g.: input("What is your name? "). see attached file. I am using Colab free version.
Please advice, what can be done? Thanks in advance!

After Google Colab gets stuck and hangs the only thing to do is to interrupt execution and re-run the cell


问:
HCL Nomad Android message box
We are using the Android HCL Nomad client to enable offline 'APP' use of a few applications and wanted to improve some of the feedback users get. Especially would like to give feedback to user like 'Thanks : document saved".

When setting up on Android (on a development server) we noticed this 'Dismiss' message:

Does anyone know if this can be called, via @Formula or LotusScript... or?

Title: HCL Nomad Android message box


问:
CSS strange lines appearing when I use the Transform: scale property
I am currently working on a website www.allsocial.app. If you scroll down so the section with the pricing, I have added a zigzag pattern via CSS code to create this effect. The center column is normal size, and the columns for the startup and professional package is made smaller using transform: scale(0.85).

The problem is that some weird lines have appeared when I scale them to make it smaller. I haven't been able to figure this out and the reason for these strange lines. At first, I thought they were borders but that doesn't seem to be the case.

This is the code I use to create the zigzag pattern.

```<code>.allsocial__standard-price:after, .allsocial__basic-price:after, .allsocial__premium-price:after {

    background: linear-gradient(-45deg, #ffffff 16px, transparent 0), linear-gradient(45deg, #ffffff 16px, transparent 0);
    background-position: left-bottom;
    background-repeat: repeat-x;
    background-size: 15px 32px;
    content: " ";
    display: block;
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    height: 32px;

}
</code>```

And this is the code I use to scale the elements.

```<code>.allsocial__premium-container {
    transform: scale(0.85);
    transform-origin: 10% 50%;
}
</code>```

If anyone knows what is the cause of these strange lines, then that would be appreciated.

I have tried border: none as I was thinking they were borders. I have also tried adding some borders, but again, this just makes it worse

I have also tried changing the linear gradient angle, but then I don't achieve the effect I want. I have also tried changing the linear gradient transparency levels.

Body:
I am currently working on a website www.allsocial.app. If you scroll down so the section with the pricing, I have added a zigzag pattern via CSS code to create this effect. The center column is normal size, and the columns for the startup and professional package is made smaller using transform: scale(0.85).

The problem is that some weird lines have appeared when I scale them to make it smaller. I haven't been able to figure this out and the reason for these strange lines. At first, I thought they were borders but that doesn't seem to be the case.

This is the code I use to create the zigzag pattern.

.allsocial__standard-price:after, .allsocial__basic-price:after, .allsocial__premium-price:after {

    background: linear-gradient(-45deg, #ffffff 16px, transparent 0), linear-gradient(45deg, #ffffff 16px, transparent 0);
    background-position: left-bottom;
    background-repeat: repeat-x;
    background-size: 15px 32px;
    content: " ";
    display: block;
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    height: 32px;

}

And this is the code I use to scale the elements.

.allsocial__premium-container {
    transform: scale(0.85);
    transform-origin: 10% 50%;
}

If anyone knows what is the cause of these strange lines, then that would be appreciated.

I have tried border: none as I was thinking they were borders. I have also tried adding some borders, but again, this just makes it worse

I have also tried changing the linear gradient angle, but then I don't achieve the effect I want. I have also tried changing the linear gradient transparency levels.


问:
In eclipse Graphical Modelling Framework Editor, How to disable a certain context menu for a Dialog Node?
In eclipse Graphical Modelling Framework Editor, How to disable a certain context menu for a Dialog Node? I want to disable 'Duplicate' menu within 'Edit' menu

I tried going through eclipse forums and internet. But nothing worked for me


问:
Client-server real-time audio streaming
I'm trying to develop a client/server realtime audio processing application. The client sends streaming audio to the server, the server sends the modified streaming audio to the client. A small delay is important to me, so the TCP is not suitable as a transport protocol.

Right now I'm using gRPC, but the delay is big. I tried to find a project similar to gRPC, but with UDP, but didn't find it. I don't have the resources to make a good framework using UDP. Then I learned about RTSP (RTP), but didn't understand if it can be used in bidirectional streaming. Help with the right direction for me. Recommend open source projects (or not) if they exist. Thanks.

Title: Client-server real-time audio streaming


问:
Dropdown with checkboxes closes when clicking checkbox in Blazor Server-side application
My Blazor application has the following dropdown with checkboxes:

```<code><div class="dropdown" style="position: absolute; top:0; right:0; ">
   <button type="button" class="btn btn-lg dropdown-toggle"   aria-haspopup="true" aria-expanded="false">Choose Columns</button>
      <ul class="dropdown-menu" role="menu" aria-expanded="false" aria-hidden="true" aria-labelledby="dropdownButton1" >
         <li><label><input type="checkbox" style="height:auto;" @bind="showDepartment"/> Department</label></li>
         [... Numerous other Checkboxes ...]
         <li><label><input type="checkbox" style="height:auto;" @bind="showName" /> Name</label></li>
      </ul>
</div>
</code>```

Everytime I click a checkbox in the dropdown, the dropdown disappears. I want it to only disappear when I click on the name of the dropdown or when I click outside of the dropdown. Is that possible to do somehow?

Body:
My Blazor application has the following dropdown with checkboxes:

   <button type="button" class="btn btn-lg dropdown-toggle"   aria-haspopup="true" aria-expanded="false">Choose Columns</button>

<input type="checkbox" style="height:auto;" @bind="showDepartment"/> Department

         [... Numerous other Checkboxes ...]

<input type="checkbox" style="height:auto;" @bind="showName" /> Name

Everytime I click a checkbox in the dropdown, the dropdown disappears. I want it to only disappear when I click on the name of the dropdown or when I click outside of the dropdown. Is that possible to do somehow?


问:
pytest fixture not behaving as expected
I have such fixture:

```<code>from typing import Generator

import pytest
from fastapi.testclient import TestClient

from myproject.asgi import app

@pytest.fixture(scope="function")
def client() -> Generator[TestClient, None, None]:
    with TestClient(app) as client_yielded:
        print('test statement')
        yield client_yielded
</code>```

I want to "cleanup" after each test and start a new test as a completely new one with state of previous test gone.

Switching from "scope=module" partly solved the problem - now the "test statement" gets printed before each test.

The problem is that the new TestClient that is being yielded is not completely "new". We're using https://python-dependency-injector.ets-labs.org and objects created using Singleton provider maintain the state between tests. Switching to default Factory provider solves the issues in testing, but we want tests to work using Singleton providers, as that's the standard behaviour.

How should I change the client function or the fixture scope definition so that that it's really start each test from scratch?

Thanks!

Title: pytest fixture not behaving as expected

Body:
I have such fixture:

from typing import Generator

import pytest
from fastapi.testclient import TestClient

from myproject.asgi import app

@pytest.fixture(scope="function")
def client() -> Generator[TestClient, None, None]:
    with TestClient(app) as client_yielded:
        print('test statement')
        yield client_yielded

I want to "cleanup" after each test and start a new test as a completely new one with state of previous test gone.

Switching from "scope=module" partly solved the problem - now the "test statement" gets printed before each test.

The problem is that the new TestClient that is being yielded is not completely "new". We're using https://python-dependency-injector.ets-labs.org and objects created using Singleton provider maintain the state between tests. Switching to default Factory provider solves the issues in testing, but we want tests to work using Singleton providers, as that's the standard behaviour.

How should I change the client function or the fixture scope definition so that that it's really start each test from scratch?

Thanks!


问:
How to save qr code by generating in flask python?
How to save a unique qrcode image?

```<code> <div class="input-container">
                <label for="college_id">College ID</label>
                <input type="text" id="college_id" name="college_id" placeholder="College ID" />
            </div>
</code>```
```<code><script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>

        <div class="form">
            <button type="button" onclick="generateQRCode()">
                Generate QR Code
            </button>
            <div id="qrcode-container" name="qrcode">
                <div id="qrcode" class="qrcode"></div>
            </div>
        </div>
</code>```
```<code><script type="text/javascript">
    function generateQRCode() {
        let college_id_code = document.getElementById("college_id").value;
        if (college_id_code) {
            let qrcodeContainer = document.getElementById("qrcode");
            qrcodeContainer.innerHTML = "";
            new QRCode(qrcodeContainer, college_id_code);
            document.getElementById("qrcode-container").style.display = "block";
        } else {
            alert("Please enter a unique college ID:");
        }
    }
</script>
</code>```

I want to save unique qrcode image in folder & by save folder by providing unique id.

Body:
How to save a unique qrcode image?

                College ID
                <input type="text" id="college_id" name="college_id" placeholder="College ID" />

            <button type="button" onclick="generateQRCode()">
                Generate QR Code
            </button>

I want to save unique qrcode image in folder & by save folder by providing unique id.


问:
SPL2LLConverter compatibility_api.h
I used SPL2LLConverter tool to migrate a project. The migration went fine but in some of the source files a compatibility_api.h is included which is nowhere to be found. Any clues of what is this file and if it is necessary? If it is, where can I find it to include it myself? I've done some research and there is no information about it.

Thanks

Title: SPL2LLConverter compatibility_api.h