问:
TypeError: (0 , _stylis.compile) is not a function antd jest
I get the following error when running tests TypeError: (0 , _stylis.compile) is not a function. This is happening when trying to render a component like so: Am I missing a config setting somewhere or are there versioning issues?</p>
```<code>    test('testing', () => {
      render(<Test />)
    })

"@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^12.1.2",
    "@types/enzyme": "^3.10.12",
    "@types/enzyme-adapter-react-16": "^1.0.6",
    "@types/jest": "^29.2.5",
"jest-environment-jsdom": "^29.3.1",
    "ts-jest": "^29.0.3",
    "typescript": "^4.6.3"

"@ant-design/icons": "^4.4.0",
    "@ant-design/pro-components": "^2.3.41",

"antd": "^5.0.4",

stack trace:
  at normalizeStyle (node_modules/@ant-design/cssinjs/lib/hooks/useStyleRegister.js:38:63)
      at node_modules/@ant-design/cssinjs/lib/hooks/useStyleRegister.js:245:22
      at node_modules/@ant-design/cssinjs/lib/hooks/useGlobalCache.js:35:37
      at Entity.update (node_modules/@ant-design/cssinjs/lib/Cache.js:25:23)
      at node_modules/@ant-design/cssinjs/lib/hooks/useGlobalCache.js:23:17
</code>```

Body:
I get the following error when running tests TypeError: (0 , _stylis.compile) is not a function. This is happening when trying to render a component like so: Am I missing a config setting somewhere or are there versioning issues?

    test('testing', () => {
      render(<Test />)
    })

"@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^12.1.2",
    "@types/enzyme": "^3.10.12",
    "@types/enzyme-adapter-react-16": "^1.0.6",
    "@types/jest": "^29.2.5",
"jest-environment-jsdom": "^29.3.1",
    "ts-jest": "^29.0.3",
    "typescript": "^4.6.3"

"@ant-design/icons": "^4.4.0",
    "@ant-design/pro-components": "^2.3.41",

"antd": "^5.0.4",

stack trace:
  at normalizeStyle (node_modules/@ant-design/cssinjs/lib/hooks/useStyleRegister.js:38:63)
      at node_modules/@ant-design/cssinjs/lib/hooks/useStyleRegister.js:245:22
      at node_modules/@ant-design/cssinjs/lib/hooks/useGlobalCache.js:35:37
      at Entity.update (node_modules/@ant-design/cssinjs/lib/Cache.js:25:23)
      at node_modules/@ant-design/cssinjs/lib/hooks/useGlobalCache.js:23:17


来源: stackexchange

问:
GridSearchCV algorithm for LSTM
I am trying to create lstm deep neural network model with gridsearchcv algorithm. However, when I run the code, gridsearchcv algorithm, as seen in the photo, the loss value is very large and the accuracy value is very small. As far as I know, the loss should be small and accuracy should be large. I couldn't find where the error is. Can anybody help.My code is below.

```<code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import r2_score, median_absolute_error, mean_absolute_error, mean_absolute_percentage_error, mean_squared_error
from keras.layers import Dense,Dropout,LSTM, LayerNormalization
from keras.models import Sequential
from datetime import datetime
# from scikeras.wrappers import KerasClassifier, KerasRegressor
from keras.wrappers.scikit_learn import KerasClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import train_test_split
import seaborn as sb
df = pd.read_excel('izmir_saatlik_tuketim_verisi.xlsx', sheet_name='Veri (2)')
time_index = pd.date_range(start='2017-01-01 00:00', periods=len(df),  freq='H')
time_index = pd.DatetimeIndex(time_index)
df['time']=time_index
df['hour']= df['time'].dt.hour
df['week']= df['time'].dt.week
df['dayofweek']= df['time'].dt.dayofweek
df['dayofyear']= df['time'].dt.dayofyear
df['month']= df['time'].dt.month
df['Unnamed: 0']=df['time']
df.rename(columns ={'Unnamed: 0':'Time'},inplace=True)
df.drop(['time'], axis=1, inplace=True)
df['Nispi_Nem(%)'].fillna(df['Nispi_Nem(%)'].median(), inplace=True)
X=df.iloc[:,2:9].values
y=df.iloc[:,1].values
X_train, X_test, y_train, y_test=train_test_split(X,y, test_size=0.1, random_state=0)

#---------------------------Normalize of data----------------------
scaler=MinMaxScaler()
X_train=scaler.fit_transform(X_train)
X_test=scaler.fit_transform(X_test)
y_train=scaler.fit_transform(y_train.reshape(-1,1))
y_test=scaler.fit_transform(y_test.reshape(-1,1))

X_train = X_train.reshape((X_train.shape[0], 1, X_train.shape[1]))
X_test = X_test.reshape((X_test.shape[0], 1, X_test.shape[1]))

#-------------------------------Built in model-------------------------
param_grid = {'batch_size' : [50,100,250],
                # 'activation':['tanh','sigmoid','relu'],
                # 'optimizer':['adam','rmsprop','adagrad'],
                'epochs' : [20,50,100],
                # 'units':[16,32,64,128,256]
                }
Dropout_rate=0.5
def create_model(units=16, optimizer='adam'):
    lstm_model = Sequential()
    lstm_model.add(LSTM(units=units,activation='tanh',return_sequences=True,
                        input_shape=(X_train.shape[1], X_train.shape[2])))
    lstm_model.add(LSTM(units=units,activation='tanh',return_sequences=False))
    lstm_model.add(Dense(1, activation='Softmax'))
    lstm_model.compile(optimizer=optimizer,loss="mae", metrics=["acc"])
    return lstm_model

tf.random.set_seed(111)

#-------------------------Hyperparamaters Optimization------------------------
model = KerasClassifier(build_fn=create_model, verbose=1)

grid = GridSearchCV(estimator=model, param_grid=param_grid, cv = 2, verbose=0)

grid_result=grid.fit(X_train, y_train)

print("Best: %f using %s" % (grid_result.best_score_, grid_result.best_params_))
[enter image description here](https://i.stack.imgur.com/BxVyJ.jpg)
</code>```

I am trying to create lstm deep neural network model with gridsearchcv algorithm. However, when I run the code, gridsearchcv algorithm, as seen in the photo, the loss value is very large and the accuracy value is very small. As far as I know, the loss should be small and accuracy should be large. loss and acc values image

ContentLicense: CC BY-SA 4.0

Title: GridSearchCV algorithm for LSTM

Body:
I am trying to create lstm deep neural network model with gridsearchcv algorithm. However, when I run the code, gridsearchcv algorithm, as seen in the photo, the loss value is very large and the accuracy value is very small. As far as I know, the loss should be small and accuracy should be large. I couldn't find where the error is. Can anybody help.My code is below.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import r2_score, median_absolute_error, mean_absolute_error, mean_absolute_percentage_error, mean_squared_error
from keras.layers import Dense,Dropout,LSTM, LayerNormalization
from keras.models import Sequential
from datetime import datetime
# from scikeras.wrappers import KerasClassifier, KerasRegressor
from keras.wrappers.scikit_learn import KerasClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import RandomizedSearchCV
from sklearn.model_selection import train_test_split
import seaborn as sb
df = pd.read_excel('izmir_saatlik_tuketim_verisi.xlsx', sheet_name='Veri (2)')
time_index = pd.date_range(start='2017-01-01 00:00', periods=len(df),  freq='H')
time_index = pd.DatetimeIndex(time_index)
df['time']=time_index
df['hour']= df['time'].dt.hour
df['week']= df['time'].dt.week
df['dayofweek']= df['time'].dt.dayofweek
df['dayofyear']= df['time'].dt.dayofyear
df['month']= df['time'].dt.month
df['Unnamed: 0']=df['time']
df.rename(columns ={'Unnamed: 0':'Time'},inplace=True)
df.drop(['time'], axis=1, inplace=True)
df['Nispi_Nem(%)'].fillna(df['Nispi_Nem(%)'].median(), inplace=True)
X=df.iloc[:,2:9].values
y=df.iloc[:,1].values
X_train, X_test, y_train, y_test=train_test_split(X,y, test_size=0.1, random_state=0)

#---------------------------Normalize of data----------------------
scaler=MinMaxScaler()
X_train=scaler.fit_transform(X_train)
X_test=scaler.fit_transform(X_test)
y_train=scaler.fit_transform(y_train.reshape(-1,1))
y_test=scaler.fit_transform(y_test.reshape(-1,1))

X_train = X_train.reshape((X_train.shape[0], 1, X_train.shape[1]))
X_test = X_test.reshape((X_test.shape[0], 1, X_test.shape[1]))

#-------------------------------Built in model-------------------------
param_grid = {'batch_size' : [50,100,250],
                # 'activation':['tanh','sigmoid','relu'],
                # 'optimizer':['adam','rmsprop','adagrad'],
                'epochs' : [20,50,100],
                # 'units':[16,32,64,128,256]
                }
Dropout_rate=0.5
def create_model(units=16, optimizer='adam'):
    lstm_model = Sequential()
    lstm_model.add(LSTM(units=units,activation='tanh',return_sequences=True,
                        input_shape=(X_train.shape[1], X_train.shape[2])))
    lstm_model.add(LSTM(units=units,activation='tanh',return_sequences=False))
    lstm_model.add(Dense(1, activation='Softmax'))
    lstm_model.compile(optimizer=optimizer,loss="mae", metrics=["acc"])
    return lstm_model

tf.random.set_seed(111)

#-------------------------Hyperparamaters Optimization------------------------
model = KerasClassifier(build_fn=create_model, verbose=1)

grid = GridSearchCV(estimator=model, param_grid=param_grid, cv = 2, verbose=0)

grid_result=grid.fit(X_train, y_train)

print("Best: %f using %s" % (grid_result.best_score_, grid_result.best_params_))
[enter image description here](https://i.stack.imgur.com/BxVyJ.jpg)

I am trying to create lstm deep neural network model with gridsearchcv algorithm. However, when I run the code, gridsearchcv algorithm, as seen in the photo, the loss value is very large and the accuracy value is very small. As far as I know, the loss should be small and accuracy should be large. loss and acc values image


问:
How to customize link toolbar on right clicking text in pdftron reactjs
Product: webviewer

Product Version:  “^7.3.3”,

Please give a brief summary of your issue:
I want to create a custom modal while selecting text and create it a link. Please share how to customize link toolbar and create a custom modal on it.


问:
How can I implement CSRF with Ember Ajax or with Ember Data?
I have an application in ember.js with golang but I don't know how to implement CSRF with Ember Ajax, I'm also using Ember Data but I don't know how to implement it with CSRF either, if you would be so kind as to provide me with an example or documentation on how to implement it, I would appreciate it.

I hope you can support me


问:
PineScript Problem To Change Table Cell Background in Multiple Timeframe

```<code>//@version=5
//Script Gabungan Indicator Trend Indicator A V2 + EMA 12 + EMA 26  + QQEMOD + MACD
// For Educational Purpose Only (Infinity Class Oalalelex by Marcel_Tripo)
indicator(title='Infinity V.5', shorttitle='Infinity V.5', overlay=true, max_labels_count=500)
MTF = input(true, 'Mulitple Timeframe Counting')
var SuperTrendTable = table.new(position.top_right, 50, 50, color.new(color.black, 100), color.new(color.black, 100), 1, color.new(color.black, 1), 1)
expma12 = ta.ema(close, 12)
expma26 = ta.ema(close, 26)
crossdown = ta.crossunder(expma12, expma26)
crossup = ta.crossover(expma12, expma26)
HitungBarEMA = ta.barssince(crossdown or crossup)

// MACD -----
[macd, sig, hist] = ta.macd(close, 12, 26, 9)
MACDcrossatas = ta.crossover(macd, sig)
MACDcrossbawah = ta.crossunder(macd, sig)
HitungBarMACD = ta.barssince(MACDcrossatas or MACDcrossbawah)
//// Ema cross Panah///
directionema = expma12 > expma26 ? "(↑)" : expma12 < expma26 ? "(↓)" : na
directionema_color = expma12 > expma26 ? color.blue : color.red

arahEma()=>
    directionema

////arah MACD
//// Ema cross Panah///
directionMACD = macd > sig ? "(↑)" : macd < sig ? "(↓)" : na
directionMACD_color = macd > sig ? color.blue : color.red

arahMACD()=>
    directionMACD

//// table macd + ema --------------

fTable(rowNumber,times )=>

    HitungBarCrossEma = request.security(syminfo.ticker, times, str.tostring(HitungBarEMA))
    HitungBarCrossMACD = request.security(syminfo.ticker, times, str.tostring(HitungBarMACD))
    UpdateArahEma = request.security(syminfo.ticker, times, arahEma())
    UpdateArahMACD = request.security(syminfo.ticker, times, arahMACD())

    if MTF // and barstate.islast
        table.cell(SuperTrendTable, 0, 0, 'Timeframe'    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 1, 'EMA CROSS '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 2, 'EMA Direction '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 3, 'MACD CROSS '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 4, 'MACD Direction '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))

        tfDes   = times==''? timeframe.period : times
        table.cell(SuperTrendTable,rowNumber, 0, tfDes  , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable,rowNumber, 1, HitungBarCrossEma, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        //table.cell(SuperTrendTable,rowNumber, 2, UpdateArahEma, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        table.cell(SuperTrendTable,rowNumber, 2, UpdateArahEma, text_color=color.white, text_size=size.tiny, bgcolor = directionema_color)
        table.cell(SuperTrendTable,rowNumber,3, HitungBarCrossMACD, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        //table.cell(SuperTrendTable,rowNumber, 4, UpdateArahMACD, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        table.cell(SuperTrendTable,rowNumber, 4, UpdateArahMACD, text_color=color.white, text_size=size.tiny, bgcolor=directionMACD_color)

fTable(1,'5')
fTable(2,'15')
fTable(3,'30')
fTable(4,'60')
fTable(5,'120')
fTable(6,'240')
</code>```

I'm trying to change the background of the table cell, if macd > sig then will show "(↑)" (with blue background in that cell),if macd < sig then will show "(↓)"  (with red background in that cell)

for now i just success to make entire row change the background where my timeframe are active. (if im in TF 2H and arrow up, then entire row will blue, even in timeframe 5M is arrow down.

i put picture to visualize my problem.
[1]: https://i.stack.imgur.com/TPEdP.png
[enter image description here][1]

thanks for the help.

Body:
//@version=5
//Script Gabungan Indicator Trend Indicator A V2 + EMA 12 + EMA 26  + QQEMOD + MACD
// For Educational Purpose Only (Infinity Class Oalalelex by Marcel_Tripo)
indicator(title='Infinity V.5', shorttitle='Infinity V.5', overlay=true, max_labels_count=500)
MTF = input(true, 'Mulitple Timeframe Counting')
var SuperTrendTable = table.new(position.top_right, 50, 50, color.new(color.black, 100), color.new(color.black, 100), 1, color.new(color.black, 1), 1)
expma12 = ta.ema(close, 12)
expma26 = ta.ema(close, 26)
crossdown = ta.crossunder(expma12, expma26)
crossup = ta.crossover(expma12, expma26)
HitungBarEMA = ta.barssince(crossdown or crossup)

// MACD -----
[macd, sig, hist] = ta.macd(close, 12, 26, 9)
MACDcrossatas = ta.crossover(macd, sig)
MACDcrossbawah = ta.crossunder(macd, sig)
HitungBarMACD = ta.barssince(MACDcrossatas or MACDcrossbawah)
//// Ema cross Panah///
directionema = expma12 > expma26 ? "(↑)" : expma12 < expma26 ? "(↓)" : na
directionema_color = expma12 > expma26 ? color.blue : color.red

arahEma()=>
    directionema

////arah MACD
//// Ema cross Panah///
directionMACD = macd > sig ? "(↑)" : macd < sig ? "(↓)" : na
directionMACD_color = macd > sig ? color.blue : color.red

arahMACD()=>
    directionMACD

//// table macd + ema --------------

fTable(rowNumber,times )=>

    HitungBarCrossEma = request.security(syminfo.ticker, times, str.tostring(HitungBarEMA))
    HitungBarCrossMACD = request.security(syminfo.ticker, times, str.tostring(HitungBarMACD))
    UpdateArahEma = request.security(syminfo.ticker, times, arahEma())
    UpdateArahMACD = request.security(syminfo.ticker, times, arahMACD())

    if MTF // and barstate.islast
        table.cell(SuperTrendTable, 0, 0, 'Timeframe'    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 1, 'EMA CROSS '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 2, 'EMA Direction '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 3, 'MACD CROSS '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable, 0, 4, 'MACD Direction '    , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))

        tfDes   = times==''? timeframe.period : times
        table.cell(SuperTrendTable,rowNumber, 0, tfDes  , text_color=color.white, text_size=size.normal, bgcolor=color.new(#6f14e6, 75))
        table.cell(SuperTrendTable,rowNumber, 1, HitungBarCrossEma, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        //table.cell(SuperTrendTable,rowNumber, 2, UpdateArahEma, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        table.cell(SuperTrendTable,rowNumber, 2, UpdateArahEma, text_color=color.white, text_size=size.tiny, bgcolor = directionema_color)
        table.cell(SuperTrendTable,rowNumber,3, HitungBarCrossMACD, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        //table.cell(SuperTrendTable,rowNumber, 4, UpdateArahMACD, text_color=color.white, text_size=size.tiny, bgcolor=color.blue)
        table.cell(SuperTrendTable,rowNumber, 4, UpdateArahMACD, text_color=color.white, text_size=size.tiny, bgcolor=directionMACD_color)

fTable(1,'5')
fTable(2,'15')
fTable(3,'30')
fTable(4,'60')
fTable(5,'120')
fTable(6,'240')

I'm trying to change the background of the table cell, if macd > sig then will show "(↑)" (with blue background in that cell),if macd < sig then will show "(↓)"  (with red background in that cell)

for now i just success to make entire row change the background where my timeframe are active. (if im in TF 2H and arrow up, then entire row will blue, even in timeframe 5M is arrow down.

i put picture to visualize my problem.
[1]: https://i.stack.imgur.com/TPEdP.png
[enter image description here][1]

thanks for the help.


问:
Can we send pdf file to front end in a lua application?
I am trying to send a pdf as a response in the lua application. I am new to lua. So I am not able to understand the concept.

```<code>return {
   headers = {
     ["content-type"] = 'attachment; name="arc_demo.pdf"',
     ["Content-Type"] = "application/pdf",
     ["content-disposition"] = 'attachment;filename="arc_demo.pdf"',
     ["content-description"] = 'test binary file',
     ["content-transfer-encoding"] = "BASE64",
   },
}
</code>```

Can anyone has an idea?

Body:
I am trying to send a pdf as a response in the lua application. I am new to lua. So I am not able to understand the concept.

return {
   headers = {
     ["content-type"] = 'attachment; name="arc_demo.pdf"',
     ["Content-Type"] = "application/pdf",
     ["content-disposition"] = 'attachment;filename="arc_demo.pdf"',
     ["content-description"] = 'test binary file',
     ["content-transfer-encoding"] = "BASE64",
   },
}

Can anyone has an idea?


问:
No new variables from InsertOne mongodb golang after adding TTL
So i have created a TTL and upon adding it this new error pops up:

no new variables on left side of := : _, err := c.Coll.InsertOne(c.Ctx, url)

code:

    indexOptions := options.Index().SetExpireAfterSeconds(int32(newUrl.Expires) * 24 * 3600)

    _, err := c.Coll.Indexes().CreateOne(c.Ctx,
        mongo.IndexModel{
            Keys:    bson.M{"exp": 1},
            Options: indexOptions},
    )
    if err != nil {
        return nil, err
    }

    url := newUrl.IntoURL()

    _, err := c.Coll.InsertOne(c.Ctx, url)
    return url, err
```

Solved, look in comments!

Body:
So i have created a TTL and upon adding it this new error pops up:

no new variables on left side of := : _, err := c.Coll.InsertOne(c.Ctx, url)

code:

    indexOptions := options.Index().SetExpireAfterSeconds(int32(newUrl.Expires) * 24 * 3600)

    _, err := c.Coll.Indexes().CreateOne(c.Ctx,
        mongo.IndexModel{
            Keys:    bson.M{"exp": 1},
            Options: indexOptions},
    )
    if err != nil {
        return nil, err
    }

    url := newUrl.IntoURL()

    _, err := c.Coll.InsertOne(c.Ctx, url)
    return url, err

Solved, look in comments!


问:
multiple font declarations from Google Fonts
I have two Google Font declarations in the 'head' section of an html page as follows:

```<code><head>
<link href="styles.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?  family=East+Sea+Dokdo&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Charmonman&display=swap" rel="stylesheet">
</code>```

In styles.css I can produce the Charmonan font in html by declaring the following in a class :

```<code>font-family:Charmonman
</code>```

However, I cannot produce the font East+Sea+Dokdo using the same declaration ie :

```<code>font-family:East+Sea+Dokdo
</code>```

Any ideas why ? Thanks

Body:
I have two Google Font declarations in the 'head' section of an html page as follows:

<link href="styles.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?  family=East+Sea+Dokdo&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Charmonman&display=swap" rel="stylesheet">

In styles.css I can produce the Charmonan font in html by declaring the following in a class :

font-family:Charmonman

However, I cannot produce the font East+Sea+Dokdo using the same declaration ie :

font-family:East+Sea+Dokdo

Any ideas why ? Thanks


问:
pywinauto: how to drag folder to a window?
I want to dray a folder by mouse and drop it to a window. How can I simulate this processing by pywinauto?

I can only find this one webpage, but it do not work. Any suggestion is appreciated~~~


问:
tsconfig.tsbuildinfo not being respected
I am committing tsconfig.tsbuildinfo file in GitHub so that we can optimize ts check on CI build, however, it is not working as expected, in fact, it is taking more time on CI and other machines.
However, if I run ts: check command twice on CI machines, the second build is extremely fast.

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "incremental": true,
    "target": "esnext",
    "module": "esnext",
    "jsx": "react",
    "noEmit": true,
    "forceConsistentCasingInFileNames": true,
    "noImplicitThis": true,
    "removeComments": true,
    "strictNullChecks": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "allowJs": true,
    "paths": {
      "api": ["app/api/index"],
      "modules/*": ["app/modules/*"],
      "lib/*": ["app/lib/*"],
      "tests/*": ["tests/*"]
    }
  },
  "include": ["**/app/*", "**/tests/*", "**/@types/*"],
  "exclude": [
    "**/node_modules/*",
    "**/internals/*",
    "**/server/*",
    "**/public/*",
    "**/ci_scripts/*",
    "**/testOutput/*",
    "**/build/*",
    "**/app/**/__tests__/*"
  ]
}
```

command in the package.json:
"ts:check": "tsc --project ./tsconfig.json"

command that we run on pipeline: npm run ts:check

Note: TS version is exactly the same for the machine where tsconfig.tsbuildinfo is originally generated and the CI machine

What could be the possible reasons?

Typescript : 4.9.3

Actual behavior
TS check not respecting tsconfig.tsbuildinfo

Expected behavior
TS check should re-use tsconfig.tsbuildinfo and execute check faster

Body:
I am committing tsconfig.tsbuildinfo file in GitHub so that we can optimize ts check on CI build, however, it is not working as expected, in fact, it is taking more time on CI and other machines.
However, if I run ts: check command twice on CI machines, the second build is extremely fast.

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "incremental": true,
    "target": "esnext",
    "module": "esnext",
    "jsx": "react",
    "noEmit": true,
    "forceConsistentCasingInFileNames": true,
    "noImplicitThis": true,
    "removeComments": true,
    "strictNullChecks": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "allowJs": true,
    "paths": {
      "api": ["app/api/index"],
      "modules/*": ["app/modules/*"],
      "lib/*": ["app/lib/*"],
      "tests/*": ["tests/*"]
    }
  },
  "include": ["**/app/*", "**/tests/*", "**/@types/*"],
  "exclude": [
    "**/node_modules/*",
    "**/internals/*",
    "**/server/*",
    "**/public/*",
    "**/ci_scripts/*",
    "**/testOutput/*",
    "**/build/*",
    "**/app/**/__tests__/*"
  ]
}

command in the package.json:
"ts:check": "tsc --project ./tsconfig.json"

command that we run on pipeline: npm run ts:check

Note: TS version is exactly the same for the machine where tsconfig.tsbuildinfo is originally generated and the CI machine

What could be the possible reasons?

Typescript : 4.9.3

Actual behavior
TS check not respecting tsconfig.tsbuildinfo

Expected behavior
TS check should re-use tsconfig.tsbuildinfo and execute check faster


问:
Sorting in Datatable (ServerSide) sql query with "Grouped by" Statement
I am using datatable jQuery plugin to render tables from MySQL database. I am able to get the table rendered as desired. But the sorting and individual search is not functioning.

here is my Script of datatable :

```<code>var table = $("#example").DataTable({
  "serverSide" : true,
  "processing" : true,
 "lengthMenu": [10,25, 50, 100 ],
   "ajax" : {
        url:"serverdata.php",
        type:"POST",
       },

    // to search individual column value
  initComplete: function() {
      var api = this.api();

      // For each column
      api
        .columns([0, 1])
        .eq(0)
        .each(function(i) {
          // Set the header cell to contain the input element
          var cell = $('.search th').eq(
            $(api.column(i).header()).index()
          );
          var title = $('#example thead tr:eq(1) th').text();
          $(cell).html('<input type="text" placeholder="Search " />');

          // On every keypress in this input
            $('input', this).on('keyup change', function(e) {
                 if (e.keyCode == 13) {
                    e.preventDefault();
                if ( table.search() !== this.value ) {
                    table
                        .search( this.value )
                        .draw();
                }
            }
            });
        });
    },

});
</code>```

PHP Code : serveride.php

```<code>$query = '';
$output = array();
$columns = array('frnumber',  'customername');

$query .= "SELECT * FROM (select frnumber from tablename";

//common search
if(isset($_POST["search"]["value"]))
{
 $query .= '
  where  frnumber LIKE "%'.$_POST["search"]["value"].'%"
  OR customername LIKE "%'.$_POST["search"]["value"].'%"
 ';
}
if(isset($_POST["order"]))
{
 $query .= ' ORDER BY '.$columns[$_POST['order']['0']['column']].' '.$_POST['order']['0']['dir'].')t1 group by frnumber ';
}
else
{
 $query .= ' ORDER BY id DESC)t1  group by frnumber ';

}

if($_POST["length"] != -1)
{
 $query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];
}

$statement = $connection->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
$data = array();
$filtered_rows = $statement->rowCount();
foreach($result as $row)
{

  $sub_array = array();
  ....
  ...
  ....
}
</code>```

I have researched for this type questions on the Stack Overflow, and there are many questions with answers, but none of them seems to work for me.

Can any one guide me?

Body:
I am using datatable jQuery plugin to render tables from MySQL database. I am able to get the table rendered as desired. But the sorting and individual search is not functioning.

here is my Script of datatable :

var table = $("#example").DataTable({
  "serverSide" : true,
  "processing" : true,
 "lengthMenu": [10,25, 50, 100 ],
   "ajax" : {
        url:"serverdata.php",
        type:"POST",
       },

    // to search individual column value
  initComplete: function() {
      var api = this.api();

      // For each column
      api
        .columns([0, 1])
        .eq(0)
        .each(function(i) {
          // Set the header cell to contain the input element
          var cell = $('.search th').eq(
            $(api.column(i).header()).index()
          );
          var title = $('#example thead tr:eq(1) th').text();
          $(cell).html('<input type="text" placeholder="Search " />');

          // On every keypress in this input
            $('input', this).on('keyup change', function(e) {
                 if (e.keyCode == 13) {
                    e.preventDefault();
                if ( table.search() !== this.value ) {
                    table
                        .search( this.value )
                        .draw();
                }
            }
            });
        });
    },

});

PHP Code : serveride.php

$query = '';
$output = array();
$columns = array('frnumber',  'customername');

$query .= "SELECT * FROM (select frnumber from tablename";

//common search
if(isset($_POST["search"]["value"]))
{
 $query .= '
  where  frnumber LIKE "%'.$_POST["search"]["value"].'%"
  OR customername LIKE "%'.$_POST["search"]["value"].'%"
 ';
}
if(isset($_POST["order"]))
{
 $query .= ' ORDER BY '.$columns[$_POST['order']['0']['column']].' '.$_POST['order']['0']['dir'].')t1 group by frnumber ';
}
else
{
 $query .= ' ORDER BY id DESC)t1  group by frnumber ';

}

if($_POST["length"] != -1)
{
 $query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];
}

$statement = $connection->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
$data = array();
$filtered_rows = $statement->rowCount();
foreach($result as $row)
{

  $sub_array = array();
  ....
  ...
  ....
}

I have researched for this type questions on the Stack Overflow, and there are many questions with answers, but none of them seems to work for me.

Can any one guide me?


问:
Removing and appending on wrapper in the same loop causes issues
I'm making a simple filtering function where I pass a sorted array into a function which is supposed to clear the wrapper and add the new ordered elements. My natural thought here is to do the removing and adding in the same loop, but I just can't get it to work and I can't really figure out why it wouldn't work.

Function that takes an array as argument. The sorted array is passed inside the function without any issues. The array is an Array.from(nodeList).

```<code>function removeAndAdd(sortedArray) {

    for (let i = 0; i < allPosts.length; i++) {
      const forumPost = allPosts[i]
      forumPost.replaceWith(sortedArray[i])
    }

}
</code>```

NOTE: I've also tried (And alot of other stuff)

```<code> for (let i = 0; i < allPosts.length; i++) {
      const forumPost = allPosts[i]
      forumPost.remove()
      wrapper.append(orderedArray[i])
    }

</code>```

My expectation is that with a single loop you should be able to clear the elements and at the same time att a new element. I don't want to use two different loops here.

Edit: I solved it by using remove() in an async function outside. I'd still love to learn technically why this didn't work.

Body:
I'm making a simple filtering function where I pass a sorted array into a function which is supposed to clear the wrapper and add the new ordered elements. My natural thought here is to do the removing and adding in the same loop, but I just can't get it to work and I can't really figure out why it wouldn't work.

Function that takes an array as argument. The sorted array is passed inside the function without any issues. The array is an Array.from(nodeList).

function removeAndAdd(sortedArray) {

    for (let i = 0; i < allPosts.length; i++) {
      const forumPost = allPosts[i]
      forumPost.replaceWith(sortedArray[i])
    }

}

NOTE: I've also tried (And alot of other stuff)

 for (let i = 0; i < allPosts.length; i++) {
      const forumPost = allPosts[i]
      forumPost.remove()
      wrapper.append(orderedArray[i])
    }

My expectation is that with a single loop you should be able to clear the elements and at the same time att a new element. I don't want to use two different loops here.

Edit: I solved it by using remove() in an async function outside. I'd still love to learn technically why this didn't work.


问:
TextFields not responding in Collection View Cell
I am trying to create a Collection View, which is somewhat like this...collection view -> 2 cells(vertically placed on screen) -> each cell contains some textFields -> click on the textField and enter your inputs.

I have added the textfields in the collection view cell file, and the cell is being called in a CollectionViewController. The problem is, the textfield are coming up fine on the UI part, but are not responding to touch. How can I solve this?

this is in a CollectionViewCell File (class AddressCollectionViewCell: UICollectionViewCell)

```<code>setTextFieldDelegates()
        backgroundColor = .clear
        contentView.addSubview(containerView)
        containerView.backgroundColor = UIColor.black
        containerView.fillSuperview()
        //containerView.heightAnchor.constraint(equalToConstant: 600)

        containerView.addSubview(addressStackView)
        addressStackView.anchor(containerView.topAnchor, left: containerView.leftAnchor, right: containerView.rightAnchor, topConstant: 12, leftConstant: 12)
        addTitleLabel()`
        addTextFieldsToStackView()
</code>```
```<code>func addTextFieldsToStackView() {

        addressStackView.addArrangedSubview(houseTextField )
        addressStackView.addArrangedSubview(pincodeTextField)
        addressStackView.addArrangedSubview(localityTextField )
        addressStackView.addArrangedSubview(areaTextField)
        addressStackView.addArrangedSubview(addressLineOneTextField))
        addressStackView.addArrangedSubview(cityTextField)
        addressStackView.addArrangedSubview(stateTextField)
}

</code>```

Body:
I am trying to create a Collection View, which is somewhat like this...collection view -> 2 cells(vertically placed on screen) -> each cell contains some textFields -> click on the textField and enter your inputs.

I have added the textfields in the collection view cell file, and the cell is being called in a CollectionViewController. The problem is, the textfield are coming up fine on the UI part, but are not responding to touch. How can I solve this?

this is in a CollectionViewCell File (class AddressCollectionViewCell: UICollectionViewCell)

setTextFieldDelegates()
        backgroundColor = .clear
        contentView.addSubview(containerView)
        containerView.backgroundColor = UIColor.black
        containerView.fillSuperview()
        //containerView.heightAnchor.constraint(equalToConstant: 600)

        containerView.addSubview(addressStackView)
        addressStackView.anchor(containerView.topAnchor, left: containerView.leftAnchor, right: containerView.rightAnchor, topConstant: 12, leftConstant: 12)
        addTitleLabel()`
        addTextFieldsToStackView()

func addTextFieldsToStackView() {

        addressStackView.addArrangedSubview(houseTextField )
        addressStackView.addArrangedSubview(pincodeTextField)
        addressStackView.addArrangedSubview(localityTextField )
        addressStackView.addArrangedSubview(areaTextField)
        addressStackView.addArrangedSubview(addressLineOneTextField))
        addressStackView.addArrangedSubview(cityTextField)
        addressStackView.addArrangedSubview(stateTextField)
}


问:
How to loop on a computed array?
my full code

https://codesandbox.io/s/test-product-w7v9c2?file=/index.tsx

```<code>let amt :number[]=[]
const [sum, setSum] = useState(0);
 const [amount, setAmount] = useState(0);
<Formik
        initialValues={initialValues}
        onSubmit={async (values) => {
          await new Promise((r) => setTimeout(r, 500));
          //alert(JSON.stringify(values, null, 2));

          values.product.map((item) => {
            let i: number = 0;
            if (item.qty && item.price) {
              amt[i] = item.qty * item.price;
              setAmount(amt[i]);
              console.log(amount);
              if (item.amount) {
                for (i; i <= amt.length; i++) {
                  const result = amt.reduce((sum, number) => {
                    return sum + number;
                  }, 0);
                  setSum(result);
                }
              }
            }
          });

          const resultAmt = values.product.reduce((sum, number) => {
            return sum + number.qty * number.price;
          }, 0);
          setSum(resultAmt);
          console.log("-------resultAmt------");
          console.log(resultAmt);

          values.product.map((item) => {
            const test = {
              product: [
                {
                  productname: item.productname,
                  qty: item.qty,
                  price: item.price,
                  amount: resultAmt
                }
              ],
              sum: 0
            };
            console.log(JSON.stringify(test));
          });
        }}
      >

</code>```

I want qty* price = amount inside array first and then get value sum but must do it outsideformik, can it be done and want to show amount and sum without pressing onSubmit

How can I retrieve the value inside a formik and  create a computational function?

Title: How to loop on a computed array?

Body:
my full code

https://codesandbox.io/s/test-product-w7v9c2?file=/index.tsx

let amt :number[]=[]
const [sum, setSum] = useState(0);
 const [amount, setAmount] = useState(0);
<Formik
        initialValues={initialValues}
        onSubmit={async (values) => {
          await new Promise((r) => setTimeout(r, 500));
          //alert(JSON.stringify(values, null, 2));

          values.product.map((item) => {
            let i: number = 0;
            if (item.qty && item.price) {
              amt[i] = item.qty * item.price;
              setAmount(amt[i]);
              console.log(amount);
              if (item.amount) {
                for (i; i <= amt.length; i++) {
                  const result = amt.reduce((sum, number) => {
                    return sum + number;
                  }, 0);
                  setSum(result);
                }
              }
            }
          });

          const resultAmt = values.product.reduce((sum, number) => {
            return sum + number.qty * number.price;
          }, 0);
          setSum(resultAmt);
          console.log("-------resultAmt------");
          console.log(resultAmt);

          values.product.map((item) => {
            const test = {
              product: [
                {
                  productname: item.productname,
                  qty: item.qty,
                  price: item.price,
                  amount: resultAmt
                }
              ],
              sum: 0
            };
            console.log(JSON.stringify(test));
          });
        }}
      >

I want qty* price = amount inside array first and then get value sum but must do it outsideformik, can it be done and want to show amount and sum without pressing onSubmit

How can I retrieve the value inside a formik and  create a computational function?


问:
GSC URL inspection: URL is not available to Google for Angular SSR app
I have an Angular SSR app, which is hosted in DigitalOcaen.
After submitting the sitemaps to GSC, this was the result for Page indexing:

The reasons mostly are these:

Server error (5xx)

Discovered - currently not indexed

When I tried to manually inspect URL, this was the result:

And when I tried to request indexing, this was the result:

This is my code for server.ts for the SSR app:

```<code>import 'zone.js/dist/zone-node';
import { ngExpressEngine } from '@nguniversal/express-engine';
import express from 'express';
import { join } from 'path';

import { AppServerModule } from './src/main.server';
import { APP_BASE_HREF } from '@angular/common';
import { existsSync } from 'fs';
import ssrForBots from 'ssr-for-bots';

export function app(): express.Express {
  const server = express();
  const distFolder = join(process.cwd(), 'dist/app/browser');
  const indexHtml = existsSync(join(distFolder, 'index.original.html'))
    ? 'index.original.html'
    : 'index';
  const defaultCrawlerOptions = {
    prerender: [
      'bot',
      'googlebot',
      'Chrome-Lighthouse',
      'DuckDuckBot',
      'ia_archiver',
      'bingbot',
      'yandex',
      'baiduspider',
      'Facebot',
      'facebookexternalhit',
      'facebookexternalhit/1.1',
      'twitterbot',
      'rogerbot',
      'linkedinbot',
      'embedly',
      'quora link preview',
      'showyoubot',
      'outbrain',
      'pinterest',
      'slackbot',
      'vkShare',
      'W3C_Validator',
    ],
    exclude: ['.xml', '.ico', '.txt', '.json'],
    useCache: true,
    cacheRefreshRate: 86400,
  };

  server.use(ssrForBots(defaultCrawlerOptions));

  server.engine(
    'html',
    ngExpressEngine({
      bootstrap: AppServerModule,
    })
  );

  server.set('view engine', 'html');
  server.set('views', distFolder);

  server.get(
    '*.*',
    express.static(distFolder, {
      maxAge: '1y',
    })
  );

  server.get('*', (req, res) => {
    res.render(indexHtml, {
      req,
      providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }],
    });
  });

  return server;
}

function run(): void {
  const port = process.env.PORT || 4000;

  const server = app();
  server.listen(port, () => {
    console.log(`Node Express server listening on http://localhost:${port}`);
  });
}

// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = (mainModule && mainModule.filename) || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
  run();
}

export * from './src/main.server';
</code>```

Please share if you're aware of any solutions, thank you.

Body:
I have an Angular SSR app, which is hosted in DigitalOcaen.
After submitting the sitemaps to GSC, this was the result for Page indexing:

The reasons mostly are these:

Server error (5xx)

Discovered - currently not indexed

When I tried to manually inspect URL, this was the result:

And when I tried to request indexing, this was the result:

This is my code for server.ts for the SSR app:

import 'zone.js/dist/zone-node';
import { ngExpressEngine } from '@nguniversal/express-engine';
import express from 'express';
import { join } from 'path';

import { AppServerModule } from './src/main.server';
import { APP_BASE_HREF } from '@angular/common';
import { existsSync } from 'fs';
import ssrForBots from 'ssr-for-bots';

export function app(): express.Express {
  const server = express();
  const distFolder = join(process.cwd(), 'dist/app/browser');
  const indexHtml = existsSync(join(distFolder, 'index.original.html'))
    ? 'index.original.html'
    : 'index';
  const defaultCrawlerOptions = {
    prerender: [
      'bot',
      'googlebot',
      'Chrome-Lighthouse',
      'DuckDuckBot',
      'ia_archiver',
      'bingbot',
      'yandex',
      'baiduspider',
      'Facebot',
      'facebookexternalhit',
      'facebookexternalhit/1.1',
      'twitterbot',
      'rogerbot',
      'linkedinbot',
      'embedly',
      'quora link preview',
      'showyoubot',
      'outbrain',
      'pinterest',
      'slackbot',
      'vkShare',
      'W3C_Validator',
    ],
    exclude: ['.xml', '.ico', '.txt', '.json'],
    useCache: true,
    cacheRefreshRate: 86400,
  };

  server.use(ssrForBots(defaultCrawlerOptions));

  server.engine(
    'html',
    ngExpressEngine({
      bootstrap: AppServerModule,
    })
  );

  server.set('view engine', 'html');
  server.set('views', distFolder);

  server.get(
    '*.*',
    express.static(distFolder, {
      maxAge: '1y',
    })
  );

  server.get('*', (req, res) => {
    res.render(indexHtml, {
      req,
      providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }],
    });
  });

  return server;
}

function run(): void {
  const port = process.env.PORT || 4000;

  const server = app();
  server.listen(port, () => {
    console.log(`Node Express server listening on http://localhost:${port}`);
  });
}

// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = (mainModule && mainModule.filename) || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
  run();
}

export * from './src/main.server';

Please share if you're aware of any solutions, thank you.


问:
Categorize the pages of a PDF file
I have thousands of scanned personal files in PDF format that are searchable.
The goal should be that I check each page in the PDF file and split or extract it into one of 50 categories. For example, I want to export all pages that have something to do with health insurance into a pdf file named Health Insurance. All pages that have something to do with pension into a corresponding file and so on. I am still thinking about how I could automate this most cleverly. At the moment my approach was:
I write a Python Script. In which I specify for each category certain keywords and if they are found, the pages are then exported accordingly. But I wonder if this is the best way for the task or if there are already other solutions before I develop the stuff again. I'm afraid that I would have to create an incredible number of rules to recognize all form data for thousands of employees. Sometimes keywords do not only appear on the page I am looking for, but also in completely different areas.
Should the problem perhaps be approached differently? Are there any ready-made solutions? The goal should be to automate as much as possible. I would be grateful for tips.

A wordbased/phrasebased search for categories in Python would probably work in principle. I already tried that, but there are a lot of detail problems.

I'm looking for ready solutions, or other approaches how to solve the problem if necessary.

Title: Categorize the pages of a PDF file


问:
How to implement navigation for epubJs in Angular
So I have successfully rendered epub via epubJs in Angular now I want my select element to populate pages with href so that I can navigate to the specific Page in epub
my epub
on top left corner there is a select element in which I want to populate options of pages

So i referred to epubjs examples

```<code>book.loaded.navigation.then(function(toc){
            var $select = document.getElementById("toc"),
                    docfrag = document.createDocumentFragment();

            toc.forEach(function(chapter) {
                var option = document.createElement("option");
                option.textContent = chapter.label;
                option.ref = chapter.href;

                docfrag.appendChild(option);
            });

            $select.appendChild(docfrag);

            $select.onchange = function(){
                    var index = $select.selectedIndex,
                            url = $select.options[index].ref;
                    rendition.display(url);
                    return false;
            };

        });
</code>```

now i Want to convert this js in Angular ts so that i can populate my select element with options

Here is my ts code

reader.ts

Here is my html code

reader.html

Body:
So I have successfully rendered epub via epubJs in Angular now I want my select element to populate pages with href so that I can navigate to the specific Page in epub
my epub
on top left corner there is a select element in which I want to populate options of pages

So i referred to epubjs examples

book.loaded.navigation.then(function(toc){
            var $select = document.getElementById("toc"),
                    docfrag = document.createDocumentFragment();

            toc.forEach(function(chapter) {
                var option = document.createElement("option");
                option.textContent = chapter.label;
                option.ref = chapter.href;

                docfrag.appendChild(option);
            });

            $select.appendChild(docfrag);

            $select.onchange = function(){
                    var index = $select.selectedIndex,
                            url = $select.options[index].ref;
                    rendition.display(url);
                    return false;
            };

        });

now i Want to convert this js in Angular ts so that i can populate my select element with options

Here is my ts code

reader.ts

Here is my html code

reader.html


问:
Problem in listing Keycloak Users by using own written storage provider that uses # sign in storageIds
I am writing a custom user storage provider for keycloak version 20.0.2, where I use a storage id scheme that has the following format:

"f:" + component_id + ":" + external_id ==> where external id is in the form 99999#fikayd

In the externalId field, I am supposed to use # sign due to corporate requirements. I am feeding externalId in this format into keycloak in the constructor of my UserAdapter class as follows:

```<code>  public KeycloakUserAdapter(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel, IdentityUserInfo user)
    {
        super(session, realm, storageProviderModel);
        //Below line is how I fed my custom EXTERNAL_ID
        //user.getUserName() returns an externalId that
        //containes pound sign like 99999#fikayd
        this.storageId = new StorageId(storageProviderModel.getId(), user.getUserName());
        this.user = user;
    }
</code>```

Having the above explain setup, I can successfully get access token from keycloak. Nevertheless, in the admin panel where I list the users, I get the the error that is shown in the below image due to the pound sign (i.e. #) in the externalId field. What would you suggest to overcome this problem that is specified in the error message? Thanks in advance.

Body:
I am writing a custom user storage provider for keycloak version 20.0.2, where I use a storage id scheme that has the following format:

"f:" + component_id + ":" + external_id ==> where external id is in the form 99999#fikayd

In the externalId field, I am supposed to use # sign due to corporate requirements. I am feeding externalId in this format into keycloak in the constructor of my UserAdapter class as follows:

  public KeycloakUserAdapter(KeycloakSession session, RealmModel realm, ComponentModel storageProviderModel, IdentityUserInfo user)
    {
        super(session, realm, storageProviderModel);
        //Below line is how I fed my custom EXTERNAL_ID
        //user.getUserName() returns an externalId that
        //containes pound sign like 99999#fikayd
        this.storageId = new StorageId(storageProviderModel.getId(), user.getUserName());
        this.user = user;
    }

Having the above explain setup, I can successfully get access token from keycloak. Nevertheless, in the admin panel where I list the users, I get the the error that is shown in the below image due to the pound sign (i.e. #) in the externalId field. What would you suggest to overcome this problem that is specified in the error message? Thanks in advance.


问:
How can I resolve Invariant Violation: requireNativeComponent: "RCTScrollContentView" was not found in the UIManager. in react native
I have been trying to create a FlatList in react native but every time I run expo it throws an error.

Below is the error:

whenever I try to run npx expo start;
ERROR  Invariant Violation: requireNativeComponent: "RCTScrollContentView" was not found in the UIManager.

This error is located at:
in RCTScrollContentView (created by ScrollView)
in RCTScrollView (created by ScrollView)
in ScrollView (created by ScrollView)
in ScrollView (created by VirtualizedList)
in VirtualizedListContextProvider (created by VirtualizedList).........

I tried to run react-native link  react-native-swipe-view expecting it to work but it still failed

my Code is here below:

```<code>const Main = () => {
const renderItem = ({ item }) => (
  <Item title={item.title} />
);

return (
  <SafeAreaView style={styles.container}>
    <FlatList
      data={DATA}
      renderItem={renderItem}
      keyExtractor={item => item.id}
    />
  </SafeAreaView>
);
}export default Main;
</code>```

I tried to run react-native link  react-native-swipe-view expecting to work but it still failed

Body:
I have been trying to create a FlatList in react native but every time I run expo it throws an error.

Below is the error:

whenever I try to run npx expo start;
ERROR  Invariant Violation: requireNativeComponent: "RCTScrollContentView" was not found in the UIManager.

This error is located at:
in RCTScrollContentView (created by ScrollView)
in RCTScrollView (created by ScrollView)
in ScrollView (created by ScrollView)
in ScrollView (created by VirtualizedList)
in VirtualizedListContextProvider (created by VirtualizedList).........

I tried to run react-native link  react-native-swipe-view expecting it to work but it still failed

my Code is here below:

const Main = () => {
const renderItem = ({ item }) => (
  <Item title={item.title} />
);

return (
  <SafeAreaView style={styles.container}>
    <FlatList
      data={DATA}
      renderItem={renderItem}
      keyExtractor={item => item.id}
    />
  </SafeAreaView>
);
}export default Main;

I tried to run react-native link  react-native-swipe-view expecting to work but it still failed


问:
Surprising results with Google Optimize AB - test (variants without any differences)
I am running an AB-test to see how much "noise" there is on results between test variants. AB - test is active on all pages and both of test variants (A and B) are similar. So there is no difference visible for customers. That being said, I would assume that differences between variant conversion rates on reports would have been smaller.

If we take a look at the results on attachment (here) , it shows that calculated conversion percent is ~
10% higher on variant A. This difference would be significant in Ecommerce and would be worth actions. However, there is nothing different between variants.

So my question is that how reliable Google Optimize results are as it shows big difference even for identical variants? Or am I missing something?

I have been trying to find an answer to this from Google Optimize's official documentation but without luck.


问:
Trying to install react-native-google-nearby-messages
I keep getting an error when trying to react-native-google-nearby-messages for react native and I don't know why I keep getting it.

I tried googling errors but unfortunately this isn't a very common package.


问:
Why image uploaded Telegram message is broken in 41 b size?
In laravel app (9.19) with guzzlehttp(7.2 ) and "laravel-notification-channels/telegram (3.0 ) I send image attached to post request like :

```<code>$response = Http::attach('document', $fileUrlToUpload, 'document.png')
    ->post(self::telegramApiUrl.$this->telegramBotToken.'/sendDocument', [
    'chat_id' => $this->channelUserId,
    'reply_to_message_id' => $replyId
] );
</code>```

where $fileUrlToUpload - is valid url to image at my local hosting (I work on kubuntu 20.04 with apache2).
My message at appers at Telegram channel, but image in Telegram message is broken and has 41b in size.

I replaced value of $fileUrlToUpload  with accessible image url, but anyway image in Telegram message is broken and has 41b in size.

How that can be fixed ?

Thanks!

Body:
In laravel app (9.19) with guzzlehttp(7.2 ) and "laravel-notification-channels/telegram (3.0 ) I send image attached to post request like :

$response = Http::attach('document', $fileUrlToUpload, 'document.png')
    ->post(self::telegramApiUrl.$this->telegramBotToken.'/sendDocument', [
    'chat_id' => $this->channelUserId,
    'reply_to_message_id' => $replyId
] );

where $fileUrlToUpload - is valid url to image at my local hosting (I work on kubuntu 20.04 with apache2).
My message at appers at Telegram channel, but image in Telegram message is broken and has 41b in size.

I replaced value of $fileUrlToUpload  with accessible image url, but anyway image in Telegram message is broken and has 41b in size.

How that can be fixed ?

Thanks!


问:
vapt testing for web application and microservices
New to vapt testing as beginner which resources i should use for web appilcation testing.

I unable to find open source tools for vapt testing.


问:
Is it possible to integrate Inspera Online Assessment Software in Angular projects?
Is it possible to use Inspera as a third-party plugin in my angular project? I want to have an online test platform, so I'm thinking of integrating Inspera into my angular project.

I want to customize the questions with my desired questions. Is it possible to do so? And if yes, will they provide us back the exam results too?


问:
Using rrweb.io console event is outputting wrong file name
Using rrweb console capturing

```<code>// my-rrweb.js
  const events = [];
  rrweb.record({
    emit: function emit(event) {
      events.push(event);
    },
    plugins: [rrweb.getRecordConsolePlugin()],
  });
</code>```

Now in my app wherever there is some log output, the file name in chrome's inspector window is always my-rrweb.js.

Example:

```<code>// myfile.js
console.log('hello');
</code>```

Chrome inspector:

```<code>hello                                                     my-rrweb.js:3451
</code>```

Body:
Using rrweb console capturing

// my-rrweb.js
  const events = [];
  rrweb.record({
    emit: function emit(event) {
      events.push(event);
    },
    plugins: [rrweb.getRecordConsolePlugin()],
  });

Now in my app wherever there is some log output, the file name in chrome's inspector window is always my-rrweb.js.

Example:

// myfile.js
console.log('hello');

Chrome inspector:

hello                                                     my-rrweb.js:3451


问:
when hit API through react-saga middleware ...?
localhost/:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received


问:
Selenium : Drag and Drop
I am trying to drag and drop an element to a targeted location. The code I used:

```<code>driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("https://letcode.in/dropable");

WebElement source = driver.findElement(By.id("draggable"));
WebElement target = driver.findElement(By.id("droppable"));

Actions act = new Actions(driver);
act.dragAndDrop(source, target).perform();
</code>```

Upon using this code, all I was able to view is that the source element being clicked and hold. it is not moved to the target location. I even tried dragAndDropBy(), ClickAndHold(). Everything is giving the same output.

Title: Selenium : Drag and Drop

Body:
I am trying to drag and drop an element to a targeted location. The code I used:

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("https://letcode.in/dropable");

WebElement source = driver.findElement(By.id("draggable"));
WebElement target = driver.findElement(By.id("droppable"));

Actions act = new Actions(driver);
act.dragAndDrop(source, target).perform();

Upon using this code, all I was able to view is that the source element being clicked and hold. it is not moved to the target location. I even tried dragAndDropBy(), ClickAndHold(). Everything is giving the same output.


问:
ValueError: Image size of 154660x122 pixels is too large. It must be less than 2^16 in each direction. I am trying to make timeline and getting error
```<code>
fig, ax = plt.subplots(figsize=(1, 1), constrained_layout=True)
_ = ax.set_ylim(-2, 1.75)
_ = ax.set_xlim("1989", "2021")
_ = ax.axhline(0, xmin=0.05, xmax=0.50, c='deeppink', zorder=1)

_ = ax.scatter(dates, np.zeros(len(dates)), s=120, c='palevioletred', zorder=2)
_ = ax.scatter(dates, np.zeros(len(dates)), s=30, c='darkmagenta', zorder=3)

label_offsets = np.zeros(len(dates))
label_offsets[::2] = 0.25
label_offsets[1::2] = -0.4
for i, (l, d) in enumerate(zip(names, dates)):
    _ = ax.text(d, label_offsets[i], l, ha='center', fontfamily='serif', fontweight='bold', color='royalblue',fontsize=8)
</code>```

I want labels to show up but it shows value error.

```<code>UserWarning: constrained_layout not applied because axes sizes collapsed to zero.  Try making figure larger or axes decorations smaller.
  fig.canvas.print_figure(bytes_io, **kw)
</code>```

It says value error i have tried changing dimensions but result is same

Body:
fig, ax = plt.subplots(figsize=(1, 1), constrained_layout=True)
_ = ax.set_ylim(-2, 1.75)
_ = ax.set_xlim("1989", "2021")
_ = ax.axhline(0, xmin=0.05, xmax=0.50, c='deeppink', zorder=1)

_ = ax.scatter(dates, np.zeros(len(dates)), s=120, c='palevioletred', zorder=2)
_ = ax.scatter(dates, np.zeros(len(dates)), s=30, c='darkmagenta', zorder=3)

label_offsets = np.zeros(len(dates))
label_offsets[::2] = 0.25
label_offsets[1::2] = -0.4
for i, (l, d) in enumerate(zip(names, dates)):
    _ = ax.text(d, label_offsets[i], l, ha='center', fontfamily='serif', fontweight='bold', color='royalblue',fontsize=8)

I want labels to show up but it shows value error.

UserWarning: constrained_layout not applied because axes sizes collapsed to zero.  Try making figure larger or axes decorations smaller.
  fig.canvas.print_figure(bytes_io, **kw)

It says value error i have tried changing dimensions but result is same


问:
Is it possible to achieve an automatic restart cron job by using Node.js PM2?
I’ve been facing a problem where one of the Cron jobs processes was suddenly killed or crashed. I’m using PHP MVC on Cloudways as my server. Previously I used node.js pm2 to restarted the cron job manually on cloudways terminal.

I would like to ask that is it possible to achieve restart cron job process automatically by using Node.js PM2?


问:
Saml2 With Spring boot Error Invalid Credentail
Created a web application with saml2 with the custom provider.It worked fine with http urls.But when deployed with https,it is giving the error of Invalid Credentails on url login/saml2/sso/{registration-id}.

This is the metadata that is being configured on IDP's side

```<code><?xml version="1.0" encoding="UTF-8"?><EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://<uri:pport>/{registration-id}">
   <md:SPSSODescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://<uri:port>/login/saml2/sso/{registration-id}" index="1"/>
   </md:SPSSODescriptor>
</EntityDescriptor>

</code>```

Using all the default properties to create a RelyingPartyRegistrationRepository.

```<code>@Override
    protected void configure(HttpSecurity https) throws Exception {

        try {
            https.authorizeRequests(authorize -> authorize.requestMatchers().anonymous().antMatchers("/").authenticated())
            .saml2Login();

        Converter<HttpServletRequest, RelyingPartyRegistration> relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(
                relyingPartyRegistrationRepository);

        https.addFilterBefore(filter, Saml2WebSsoAuthenticationFilter.class);
    }
        catch(Exception ex) {
            ex.printStackTrace();
        }
    }
</code>```

It should go the landing page

Body:
Created a web application with saml2 with the custom provider.It worked fine with http urls.But when deployed with https,it is giving the error of Invalid Credentails on url login/saml2/sso/{registration-id}.

This is the metadata that is being configured on IDP's side

<?xml version="1.0" encoding="UTF-8"?><EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://<uri:pport>/{registration-id}">
   <md:SPSSODescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
      <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://<uri:port>/login/saml2/sso/{registration-id}" index="1"/>
   </md:SPSSODescriptor>
</EntityDescriptor>

Using all the default properties to create a RelyingPartyRegistrationRepository.

@Override
    protected void configure(HttpSecurity https) throws Exception {

        try {
            https.authorizeRequests(authorize -> authorize.requestMatchers().anonymous().antMatchers("/").authenticated())
            .saml2Login();

        Converter<HttpServletRequest, RelyingPartyRegistration> relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(
                relyingPartyRegistrationRepository);

        https.addFilterBefore(filter, Saml2WebSsoAuthenticationFilter.class);
    }
        catch(Exception ex) {
            ex.printStackTrace();
        }
    }

It should go the landing page


问:
Save data from dataTable to image on disk
I am using .NET console application that fills DataTable from database. Is there anyway to convert DataTable data into image and save it on disk?

Any advice on what I can do?


问:
QXmpp - How to check if a QXmppMessage has the delay element attached?
I am trying to determine if an incoming message is a delayed offline message.

I've read that QXmpp supports XEP - 0203 Delayed Delivery, and I have gone through the QXmpp documentation, but I can't seem to find a way to check if a QXmppMessage has the delay element attached. Can someone please offer a solution to check for the delay element? Appreciate any help, thanks.

https://doc.qxmpp.org/qxmpp-1.3.2/xep.html


问:
Unittest test not using correct config file specified in the conftest.py
I have in my conftest.py a container (dependency injector) which "patches" over my prod config.yaml with a test.yaml. This is initialised in the conftest.py module, like so:

```<code>@pytest.fixture(scope="session")
def test_initialize():
    test_container = initialize(test_yaml_dir)
    return test_container

@pytest.fixture(scope="session")
def test_instantiate_mgr(test_initialize):
    test_id = "123456"

    test_name = test_initialize.config.env.stage_name()

    test_m = Manager(
        id=test_id,
        stage_name=test_name,
    )

    return test_tm
</code>```

This calls the parameters in the test.yaml (not the config.yaml), and is verified to work.

In my test1.py

```<code>def _test_get_match_url(test_instantiate_mgr)
    assert test_instantiate_mgr._get_match_url().get("dept") == "https://invalid/again_invalid_1"
</code>```

So the returned value in test_instantiate_mgr._get_match_url().get("dept") is the one given in my config.yaml, and not the one in the test.yaml

And the _get_match_url() in a different module (manager.py):

manager.py

```<code># set above
container = initialize(prod_yaml)
container.config()
</code>```

...

```<code>def _get_match_url(self, env) -> dict:
    base_url = container.config.urls.base_url()
    stage = env
    if stage == "a":
        return {"dept1": base_url + container.config.urls.dept1_s(),
                "dept2": base_url + container.config.urls.dept2_s()}
    elif stage == "b":
        return {"dept1": base_url + container.config.urls.dept1(),
                "dept2": base_url + container.config.urls.dept2()}
</code>```

I had expected that the conftest.py fixture would use the test.yaml everwhere, but it is only used correctly for part of the test. However the call is not used in the _get_match_url method. How can I get the test to use the correct yaml (i.e. the test.yaml), and not the config.yaml?

Body:
I have in my conftest.py a container (dependency injector) which "patches" over my prod config.yaml with a test.yaml. This is initialised in the conftest.py module, like so:

@pytest.fixture(scope="session")
def test_initialize():
    test_container = initialize(test_yaml_dir)
    return test_container

@pytest.fixture(scope="session")
def test_instantiate_mgr(test_initialize):
    test_id = "123456"

    test_name = test_initialize.config.env.stage_name()

    test_m = Manager(
        id=test_id,
        stage_name=test_name,
    )

    return test_tm

This calls the parameters in the test.yaml (not the config.yaml), and is verified to work.

In my test1.py

def _test_get_match_url(test_instantiate_mgr)
    assert test_instantiate_mgr._get_match_url().get("dept") == "https://invalid/again_invalid_1"

So the returned value in test_instantiate_mgr._get_match_url().get("dept") is the one given in my config.yaml, and not the one in the test.yaml

And the _get_match_url() in a different module (manager.py):

manager.py

# set above
container = initialize(prod_yaml)
container.config()

...

def _get_match_url(self, env) -> dict:
    base_url = container.config.urls.base_url()
    stage = env
    if stage == "a":
        return {"dept1": base_url + container.config.urls.dept1_s(),
                "dept2": base_url + container.config.urls.dept2_s()}
    elif stage == "b":
        return {"dept1": base_url + container.config.urls.dept1(),
                "dept2": base_url + container.config.urls.dept2()}

I had expected that the conftest.py fixture would use the test.yaml everwhere, but it is only used correctly for part of the test. However the call is not used in the _get_match_url method. How can I get the test to use the correct yaml (i.e. the test.yaml), and not the config.yaml?


问:
How to implement file sharing with Web Share API in Nuxt with @nuxtjs/pwa
I'm having a hard time to implement sharing an image to my nuxt PWA app. Sharing text was a piece of cake with a simple GET request. But my problems start as soon I as change to a POST request and a service worker is necessary to handle the logic.

Here's my share_target config:

```<code>share_target: {
        action: '/shared',
        method: 'POST',
        enctype: 'multipart/form-data',
        params: {
          text: 'text',
          files: [
            {
              name: 'image',
              accept: ['image/*'],
            },
          ],
        },
      },
</code>```

I already had a service worker to handle the user being offline, and it had an event listener for fetch:

```<code>self.addEventListener('fetch', (event) => {

  if (event.request.mode === 'navigate') {
    event.respondWith(
      (async () => {
        try {
          const preloadResponse = await event.preloadResponse
          if (preloadResponse) {
            return preloadResponse
          }

          const networkResponse = await fetch(event.request)
          return networkResponse
        } catch (error) {
          console.log('Fetch failed; returning offline page instead.', error)

          const cache = await caches.open(CACHE_NAME)
          const cachedResponse = await cache.match(OFFLINE_URL)
          return cachedResponse
        }
      })()
    )
  }
})
</code>```

So I tried all these things:

Adding a second if to that handler;

Adding a second handler to the fetch event;

Creating another service worker just to load data;

Here's the logic of the handler:

```<code>self.addEventListener('fetch', (event) => {
  if (
    event.request.method !== 'POST' ||
    !event.request.url.includes('/shared')
  ) {
    event.respondWith(fetch(event.request))
    return
  }

  event.respondWith(Response.redirect('/shared'))
  event.waitUntil(
    (async () => {
      const client = await self.clients.get(
        event.resultingClientId || event.clientId
      )
      const data = await event.request.formData()
      const image = data.get('image')
      const text = data.get('text')
      // send the image data to the client
      client.postMessage({ text, image })
    })()
  )
})
</code>```

On the client I'm just listening to the serviceWorker message:

```<code>mounted() {
    navigator.serviceWorker.onmessage = function (event) {
      const imageBlob = event.data.image
      const text = event.data.text
    }
  }
}
</code>```

I'm basically either getting a page not found, or I don't get anything at all when I do reach the page. Would appreciate some guidance here. Is there something I'm missing?

Cheers

Body:
I'm having a hard time to implement sharing an image to my nuxt PWA app. Sharing text was a piece of cake with a simple GET request. But my problems start as soon I as change to a POST request and a service worker is necessary to handle the logic.

Here's my share_target config:

share_target: {
        action: '/shared',
        method: 'POST',
        enctype: 'multipart/form-data',
        params: {
          text: 'text',
          files: [
            {
              name: 'image',
              accept: ['image/*'],
            },
          ],
        },
      },

I already had a service worker to handle the user being offline, and it had an event listener for fetch:

self.addEventListener('fetch', (event) => {

  if (event.request.mode === 'navigate') {
    event.respondWith(
      (async () => {
        try {
          const preloadResponse = await event.preloadResponse
          if (preloadResponse) {
            return preloadResponse
          }

          const networkResponse = await fetch(event.request)
          return networkResponse
        } catch (error) {
          console.log('Fetch failed; returning offline page instead.', error)

          const cache = await caches.open(CACHE_NAME)
          const cachedResponse = await cache.match(OFFLINE_URL)
          return cachedResponse
        }
      })()
    )
  }
})

So I tried all these things:

Adding a second if to that handler;

Adding a second handler to the fetch event;

Creating another service worker just to load data;

Here's the logic of the handler:

self.addEventListener('fetch', (event) => {
  if (
    event.request.method !== 'POST' ||
    !event.request.url.includes('/shared')
  ) {
    event.respondWith(fetch(event.request))
    return
  }

  event.respondWith(Response.redirect('/shared'))
  event.waitUntil(
    (async () => {
      const client = await self.clients.get(
        event.resultingClientId || event.clientId
      )
      const data = await event.request.formData()
      const image = data.get('image')
      const text = data.get('text')
      // send the image data to the client
      client.postMessage({ text, image })
    })()
  )
})

On the client I'm just listening to the serviceWorker message:

mounted() {
    navigator.serviceWorker.onmessage = function (event) {
      const imageBlob = event.data.image
      const text = event.data.text
    }
  }
}

I'm basically either getting a page not found, or I don't get anything at all when I do reach the page. Would appreciate some guidance here. Is there something I'm missing?

Cheers


问:
Getting Error on woocommerce Rest API with 403 forbidden
I am getting an issue on woocommerce reset api, some time before its works fine. for the last two days i have been getting error.

wp-json/wc/v3/coupons

```<code>{
    "code": "woocommerce_rest_cannot_view",
    "message": "Sorry, you cannot list resources.",
    "data": {
        "status": 403
    }
}
</code>```

I have done changes .htaccess file.  but still getting same error.

add this one:

```<code>RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</code>```

Complete htaccess:

Note: User has allow read and write permission .

Getting issue on woocommerce rest api 403 forbidden  according to customer consumer_key and consumer_secret.

Body:
I am getting an issue on woocommerce reset api, some time before its works fine. for the last two days i have been getting error.

wp-json/wc/v3/coupons

{
    "code": "woocommerce_rest_cannot_view",
    "message": "Sorry, you cannot list resources.",
    "data": {
        "status": 403
    }
}

I have done changes .htaccess file.  but still getting same error.

add this one:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Complete htaccess:

Note: User has allow read and write permission .

Getting issue on woocommerce rest api 403 forbidden  according to customer consumer_key and consumer_secret.


问:
Anonymous function converted to a void returning delegate cannot return a value when try modify expression
I have a expression and want to modify it. Just add code before and after the expression:

```<code>private Expression<Action<T>> GenerateMethodCallWithMoniroting<T>(string recurringJobId, Expression<Action<T>> methodCall)
{
   return m =>
   {
     var transaction = Agent.Tracer.StartTransaction(recurringJobId, ApiConstants.ActionExec);
     try
     {
       return methodCall.Compile().Invoke(m); //error here
     }
     finally
     {
       transaction?.End();
     }
  };
}
</code>```

I commented where it shows the error Anonymous function converted to a void returning delegate cannot return a value

I don't quite understand how to fix it...

Body:
I have a expression and want to modify it. Just add code before and after the expression:

private Expression<Action<T>> GenerateMethodCallWithMoniroting<T>(string recurringJobId, Expression<Action<T>> methodCall)
{
   return m =>
   {
     var transaction = Agent.Tracer.StartTransaction(recurringJobId, ApiConstants.ActionExec);
     try
     {
       return methodCall.Compile().Invoke(m); //error here
     }
     finally
     {
       transaction?.End();
     }
  };
}

I commented where it shows the error Anonymous function converted to a void returning delegate cannot return a value

I don't quite understand how to fix it...


问:
how can I write back to source excel file when I get excel data from data tab?
So, I want to create one Excel file each for every manager with only one single sheet and place it on OneDrive.

In order to get the data in one place, I am creating another excel file called combined.xlsx.

Now, I can export each workbook to a tab using Data -> Get Data -> From File -> From Workbook .

This is great so far. So, I can read data of 10 excelfiles on 10 sheets in combined.xlsx.

Now, I want to modify contents of one of the tabs and make sure it is reflected to the original file. How can I do this?


问:
Web site with favicon.ico not visible
I am having a little issue with the favicon.ico in a React app.
I am not actually sure the fact it is React is relevant. Here is the index.html file:

```<code><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
    ........
  </head>
  <body>
    ........
  </body>
</html>
</code>```

And I have checked that the favicon.ico file is present in the public folder.
Nevertheless the image I see when I open the page in my browser is an unrelated image.
It is in fact the favicon.ico file from a different app.
Why is this happening? What could I be missing?

Title: Web site with favicon.ico not visible

Body:
I am having a little issue with the favicon.ico in a React app.
I am not actually sure the fact it is React is relevant. Here is the index.html file:

<!DOCTYPE html>

    <meta charset="utf-8" />
    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
    ........

    ........

And I have checked that the favicon.ico file is present in the public folder.
Nevertheless the image I see when I open the page in my browser is an unrelated image.
It is in fact the favicon.ico file from a different app.
Why is this happening? What could I be missing?


问:
How can I provide an imperative default for a relation in miniKanren?
(I am using CHICKEN Scheme's miniKanren, but I would appreciate portable answers!)

Suppose I have some relation:

(define (rel° x)
  (conde
    ((pred?° x))
    ((== x (my-awesome-imperative-thing)))))
```
<p>The intention is that this relation can allow <code>x</code> to be either ground or variable. When it is ground, it satisfies some relationally-computed predicate. When it's variable, it satisfies the predicate and also is unified with some imperative value-generating procedure's output.</p>
<p>There's a relatively obvious problem, though; <code>conde</code> clauses need to be idempotent. Suppose my imperative thing isn't idempotent, but I can guarantee that we'll only call <code>rel°</code> at most once per logic variable; if nothing else grounds that variable, then <code>rel°</code> will be the "writer" of the variable and all other relations will be the "readers", and it's safe/correct-ish. In this special case, <strong>is this pattern possible with miniKanren?</strong> And if you want to use more words, <strong>what are the costs and tradeoffs?</strong></p>
<p>My motivation is to explore a possible solution for an existing question of mine. In that case, the relation is something like:</p>
<pre class="lang-lisp prettyprint-override"><code>(define (gensym° x)
  (conde
    ((symbol° x))
    ((== x (gensym)))))
</code>```

I've tried a few different things, but nothing works yet.

Body:
(I am using CHICKEN Scheme's miniKanren, but I would appreciate portable answers!)

Suppose I have some relation:

(define (rel° x)
  (conde
    ((pred?° x))
    ((== x (my-awesome-imperative-thing)))))

The intention is that this relation can allow x to be either ground or variable. When it is ground, it satisfies some relationally-computed predicate. When it's variable, it satisfies the predicate and also is unified with some imperative value-generating procedure's output.

There's a relatively obvious problem, though; conde clauses need to be idempotent. Suppose my imperative thing isn't idempotent, but I can guarantee that we'll only call rel° at most once per logic variable; if nothing else grounds that variable, then rel° will be the "writer" of the variable and all other relations will be the "readers", and it's safe/correct-ish. In this special case, is this pattern possible with miniKanren? And if you want to use more words, what are the costs and tradeoffs?

My motivation is to explore a possible solution for an existing question of mine. In that case, the relation is something like:

(define (gensym° x)
  (conde
    ((symbol° x))
    ((== x (gensym)))))

I've tried a few different things, but nothing works yet.


问:
ModuleNotFoundError : No module named 'sklearn.externals.six'
```<code>dot_data = StringIO()
tree.export_graphviz(clf, out_file=dot_data,
                         feature_names=features)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
Image(graph.create_png())
</code>```

I am trying to make a decision tree, but i am having an of no module  named sklearn.sixternal.six

Body:
dot_data = StringIO()
tree.export_graphviz(clf, out_file=dot_data,
                         feature_names=features)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
Image(graph.create_png())

I am trying to make a decision tree, but i am having an of no module  named sklearn.sixternal.six


问:
Permission denied when trying to copy files from docker container to host
I am trying to follow this question as a guide for how to copy a file from a docker container back to the host however I am getting a permission denied error as can be seen in the following copy of my terminal:

```<code>mdbl@mdblLXPS:~/Documents/research/docker/copying$ ls -ltr
total 12
-rw-rw-r-- 1 mdbl mdbl  28 Jan  2 23:26 Dockerfile
-rw-rw-r-- 1 mdbl mdbl 368 Jan  2 23:52 script.sh
-rwxrwxrwx 1 mdbl mdbl  15 Jan  3 00:16 test.txt
mdbl@mdblLXPS:~/Documents/research/docker/copying$ cat Dockerfile
FROM alpine
COPY test.txt .
mdbl@mdblLXPS:~/Documents/research/docker/copying$ cat test.txt
this is a test
mdbl@mdblLXPS:~/Documents/research/docker/copying$ cat script.sh
echo create the image
sudo docker build -t testimg .
echo
echo list the newly created image
sudo docker images | head -2
echo
echo create the container
sudo docker container create --name mycont testimg
echo
echo list the newly created container
sudo docker container ls -a | head -2
echo
echo try copying test.txt from the container
sudo docker cp mycont:/test.txt .
mdbl@mdblLXPS:~/Documents/research/docker/copying$ source script.sh
create the image
Sending build context to Docker daemon  4.096kB
Step 1/2 : FROM alpine
 ---> 49176f190c7e
Step 2/2 : COPY test.txt .
 ---> 70b40a27f26d
Successfully built 70b40a27f26d
Successfully tagged testimg:latest

list the newly created image
REPOSITORY               TAG       IMAGE ID       CREATED                  SIZE
testimg                  latest    70b40a27f26d   Less than a second ago   7.05MB

create the container
9c9396df4ab3e0538eb1aa995f13852d5328fbaa5597c82b731bb177cf809068

list the newly created container
CONTAINER ID   IMAGE          COMMAND                  CREATED                  STATUS                           PORTS     NAMES
9c9396df4ab3   testimg        "/bin/sh"                Less than a second ago   Created                                    mycont

try copying test.txt from the container
unlinkat /home/mdbl/Documents/research/docker/copying/test.txt: permission denied
</code>```

I create a docker image from an alpine base image that contains a test file test.txt. Then I create a container from this image and try to copy this file back to the host, however I get the error unlinkat /home/mdbl/Documents/research/docker/copying/test.txt: permission denied. This is despite the fact that test.txt has full permissions associated to it as can be seen by the ls -ltr command. Why is this and how can I resolve this error?

Body:
I am trying to follow this question as a guide for how to copy a file from a docker container back to the host however I am getting a permission denied error as can be seen in the following copy of my terminal:

mdbl@mdblLXPS:~/Documents/research/docker/copying$ ls -ltr
total 12
-rw-rw-r-- 1 mdbl mdbl  28 Jan  2 23:26 Dockerfile
-rw-rw-r-- 1 mdbl mdbl 368 Jan  2 23:52 script.sh
-rwxrwxrwx 1 mdbl mdbl  15 Jan  3 00:16 test.txt
mdbl@mdblLXPS:~/Documents/research/docker/copying$ cat Dockerfile
FROM alpine
COPY test.txt .
mdbl@mdblLXPS:~/Documents/research/docker/copying$ cat test.txt
this is a test
mdbl@mdblLXPS:~/Documents/research/docker/copying$ cat script.sh
echo create the image
sudo docker build -t testimg .
echo
echo list the newly created image
sudo docker images | head -2
echo
echo create the container
sudo docker container create --name mycont testimg
echo
echo list the newly created container
sudo docker container ls -a | head -2
echo
echo try copying test.txt from the container
sudo docker cp mycont:/test.txt .
mdbl@mdblLXPS:~/Documents/research/docker/copying$ source script.sh
create the image
Sending build context to Docker daemon  4.096kB
Step 1/2 : FROM alpine
 ---> 49176f190c7e
Step 2/2 : COPY test.txt .
 ---> 70b40a27f26d
Successfully built 70b40a27f26d
Successfully tagged testimg:latest

list the newly created image
REPOSITORY               TAG       IMAGE ID       CREATED                  SIZE
testimg                  latest    70b40a27f26d   Less than a second ago   7.05MB

create the container
9c9396df4ab3e0538eb1aa995f13852d5328fbaa5597c82b731bb177cf809068

list the newly created container
CONTAINER ID   IMAGE          COMMAND                  CREATED                  STATUS                           PORTS     NAMES
9c9396df4ab3   testimg        "/bin/sh"                Less than a second ago   Created                                    mycont

try copying test.txt from the container
unlinkat /home/mdbl/Documents/research/docker/copying/test.txt: permission denied

I create a docker image from an alpine base image that contains a test file test.txt. Then I create a container from this image and try to copy this file back to the host, however I get the error unlinkat /home/mdbl/Documents/research/docker/copying/test.txt: permission denied. This is despite the fact that test.txt has full permissions associated to it as can be seen by the ls -ltr command. Why is this and how can I resolve this error?


问:
File is not getting deleted in Android Java?
File is not getting deleted in Android, I have checked all premissions, and I tried all the solutions available in the internet but nothing helps. Your help will be highly assist me. Thanks in advance.

I used the below permissions

```<code><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
</code>```

And this is the code I used

```<code>File dir = Environment.getExternalStorageDirectory();
String path = dir.getAbsolutePath() + "/Recordings/Call/" + filename;
File fdelete = new File(path);
    if (fdelete.exists()) {
      if (fdelete.delete()) {
        System.out.println("file Deleted :" + path);
      } else {
        System.out.println("file not Deleted :" + path);
      }
 }
</code>```

And the err log is

```<code>W/soft.my_app_name: Got a deoptimization request on un-deoptimizable method void libcore.io.Linux.remove(java.lang.String)
</code>```

Error log is

Body:
File is not getting deleted in Android, I have checked all premissions, and I tried all the solutions available in the internet but nothing helps. Your help will be highly assist me. Thanks in advance.

I used the below permissions

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

And this is the code I used

File dir = Environment.getExternalStorageDirectory();
String path = dir.getAbsolutePath() + "/Recordings/Call/" + filename;
File fdelete = new File(path);
    if (fdelete.exists()) {
      if (fdelete.delete()) {
        System.out.println("file Deleted :" + path);
      } else {
        System.out.println("file not Deleted :" + path);
      }
 }

And the err log is

W/soft.my_app_name: Got a deoptimization request on un-deoptimizable method void libcore.io.Linux.remove(java.lang.String)

Error log is


问:
How to run selenium script with fixed time and how to host it
I created a script for automating a system. But I am stuck with the hosting the script and with the time. Lets discuss about the time first.

Here is my code:

```<code>from ray import SMSBot
import schedule

with SMSBot() as sms:
    def execute():
        sms.go_to_dashboard("https://sms.rayadvertising.com/login")
        sms.login_to_dashboard("*****", "*****")
        sms.find_number_section()

schedule.every(1).minute.do(execute())
schedule.every(20).minute.do(execute())
schedule.every(2).hour.do(execute())
schedule.every(12).hour.do(execute())
schedule.every(24).hour.do(execute())
schedule.every(26).hour.do(execute())
</code>```

I tried this code. But I am afraid of taking this script on deployment.

What I want:

I want the script run after 5 min then 20 min then 2 hour then 12 hour then 24 hour then 26 hour.
how can I do that? Is my code ok?

second thing is I want to host it. Where and how can I host this script. I am running ubuntu in laptop I know I can run the script in my laptop but its not possible to keep running the laptop whole day.

Is there any help for me?

Body:
I created a script for automating a system. But I am stuck with the hosting the script and with the time. Lets discuss about the time first.

Here is my code:

from ray import SMSBot
import schedule

with SMSBot() as sms:
    def execute():
        sms.go_to_dashboard("https://sms.rayadvertising.com/login")
        sms.login_to_dashboard("*****", "*****")
        sms.find_number_section()

schedule.every(1).minute.do(execute())
schedule.every(20).minute.do(execute())
schedule.every(2).hour.do(execute())
schedule.every(12).hour.do(execute())
schedule.every(24).hour.do(execute())
schedule.every(26).hour.do(execute())

I tried this code. But I am afraid of taking this script on deployment.

What I want:

I want the script run after 5 min then 20 min then 2 hour then 12 hour then 24 hour then 26 hour.
how can I do that? Is my code ok?

second thing is I want to host it. Where and how can I host this script. I am running ubuntu in laptop I know I can run the script in my laptop but its not possible to keep running the laptop whole day.

Is there any help for me?