问:
How to delete Prometheus & Grafana data manually?
I have a VM with 4GB storage. I setup Docker & Prometheus and Grafana with the following config:

```<code>prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    restart: unless-stopped
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus_data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/etc/prometheus/console_libraries'
      - '--web.console.templates=/etc/prometheus/consoles'
      - '--web.enable-lifecycle'
    expose:
      - 9090
    networks:
      - monitoring
  grafana:
    image: grafana/grafana:latest
    ports:
     - 3000:3000
    networks:
      - monitoring
</code>```

I forgot to add following flags to Prometheus entry.

```<code> - "--storage.tsdb.retention.time=60m"
 - "--storage.tsdb.retention.size=512MB"
</code>```

so my disk filled up pretty quickly and I cannot perform any operations due to disk space is full. I am getting errors like from different sources

```<code>error: file write error: No space left on device
</code>```
```<code>logger=cleanup t=2022-12-11T14:06:53.402543926Z level=error msg="failed to lock and execute cleanup of old login attempts" error="database or disk is full"
</code>```
```<code>ts=2022-12-11T13:38:35.765Z caller=db.go:908 level=error component=tsdb msg="compaction failed" err="compact head: persist head block: populate block: write chunks: preallocate: no space left on device"
</code>```

I attempted to delete prometheus and grafana containers from docker but it did not help to reduce disk size.

How can I delete all the previously collected data (there I don't care about them) and start with those retention limitations?

Body:
I have a VM with 4GB storage. I setup Docker & Prometheus and Grafana with the following config:

prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    restart: unless-stopped
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus_data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/etc/prometheus/console_libraries'
      - '--web.console.templates=/etc/prometheus/consoles'
      - '--web.enable-lifecycle'
    expose:
      - 9090
    networks:
      - monitoring
  grafana:
    image: grafana/grafana:latest
    ports:
     - 3000:3000
    networks:
      - monitoring

I forgot to add following flags to Prometheus entry.

 - "--storage.tsdb.retention.time=60m"
 - "--storage.tsdb.retention.size=512MB"

so my disk filled up pretty quickly and I cannot perform any operations due to disk space is full. I am getting errors like from different sources

error: file write error: No space left on device

logger=cleanup t=2022-12-11T14:06:53.402543926Z level=error msg="failed to lock and execute cleanup of old login attempts" error="database or disk is full"

ts=2022-12-11T13:38:35.765Z caller=db.go:908 level=error component=tsdb msg="compaction failed" err="compact head: persist head block: populate block: write chunks: preallocate: no space left on device"

I attempted to delete prometheus and grafana containers from docker but it did not help to reduce disk size.

How can I delete all the previously collected data (there I don't care about them) and start with those retention limitations?


来源: stackexchange

问:
Power Apps doesn't return any Cavas applications
I'm making my first steps with Power Apps and its web API and failing on the most basic request. I created two super simple canvas applications, yet I'm getting a successful but empty response from the API.

Request URL is:

```<code>https://<my-org>.api.crm4.dynamics.com//api/data/v9.2/canvasapps
</code>```

Response is:

```<code>{
    "@odata.context": "https://<my-org>.api.crm4.dynamics.com/api/data/v9.2/$metadata#canvasapps",
    "value": []
}
</code>```

Any idea what's missing?

ContentLicense: CC BY-SA 4.0

Body:
I'm making my first steps with Power Apps and its web API and failing on the most basic request. I created two super simple canvas applications, yet I'm getting a successful but empty response from the API.

Request URL is:

https://<my-org>.api.crm4.dynamics.com//api/data/v9.2/canvasapps

Response is:

{
    "@odata.context": "https://<my-org>.api.crm4.dynamics.com/api/data/v9.2/$metadata#canvasapps",
    "value": []
}

Any idea what's missing?


问:
Uses of Joblib (python) to run a FOR loop in parallel
I'm looking to implement a Parallel structure in one of my code, if it's actually possible with the pythons limitations (GIL). The code is using a FEM (finite element modelling) structure and the script solve a set of equations for each element multiple times. Here is the current structure in pseudo-code (I simplify most of it but it give a better idea without all the complicated stuff):

```<code>def compute(arg_1, arg_2, arg_3):
    answer_1 = some_library_use(arg_1 * arg_2)
    answer_2 = some_other_library(arg_2 * arg_3)
    return answer_1, answer_2

for iel in range(nels):  # loop over each elements
    answer_1, answer_2 = compute(arg_1, arg_2, arg_3)
</code>```

I have trouble understanding how to change my current script to make use of Joblib Parallel capabilities. My initial guess look like that:

```<code>def compute(arg_1, arg_2, arg_3):
    answer_1 = some_library_use(arg_1 * arg_2)
    answer_2 = some_other_library(arg_2 * arg_3)
    return answer_1, answer_2

answer_1, answer_2 = Parallel(n_jobs=2)(delayed(compute)(iel) for iel in range(nels))
</code>```

And I'm stuck on how to add my arguments. Could someone help me out to figure out if my logic is not applicable in this case or wrong? Or maybe give me some pointers?

Body:
I'm looking to implement a Parallel structure in one of my code, if it's actually possible with the pythons limitations (GIL). The code is using a FEM (finite element modelling) structure and the script solve a set of equations for each element multiple times. Here is the current structure in pseudo-code (I simplify most of it but it give a better idea without all the complicated stuff):

def compute(arg_1, arg_2, arg_3):
    answer_1 = some_library_use(arg_1 * arg_2)
    answer_2 = some_other_library(arg_2 * arg_3)
    return answer_1, answer_2

for iel in range(nels):  # loop over each elements
    answer_1, answer_2 = compute(arg_1, arg_2, arg_3)

I have trouble understanding how to change my current script to make use of Joblib Parallel capabilities. My initial guess look like that:

def compute(arg_1, arg_2, arg_3):
    answer_1 = some_library_use(arg_1 * arg_2)
    answer_2 = some_other_library(arg_2 * arg_3)
    return answer_1, answer_2

answer_1, answer_2 = Parallel(n_jobs=2)(delayed(compute)(iel) for iel in range(nels))

And I'm stuck on how to add my arguments. Could someone help me out to figure out if my logic is not applicable in this case or wrong? Or maybe give me some pointers?


问:
Adding a boat to the Gazebo environment
I want to work on a surface vehicle in the gazebo environment. I've looked at various resources on this topic, but haven't been able to find a working example file for the system I'm using. In the sources I found, the vehicle sinks into the water. I also did research to get it on the water, but I couldn't get any results. My system information is as follows. Is there a source for my system information where I can work on the surface vehicle? Or do I need to change the version?

System info:

Ubuntu 20.04

ROS Noetic Distribution

Gazebo 11

I added ocean and boat model to Gazebo environment. To keep the boat afloat, I looked at this resource:

https://classic.gazebosim.org/tutorials?tut=hydrodynamics&cat=physics

I added the codes in this resource to the boat.sdf file. But the boat did not rise above the water.

Title: Adding a boat to the Gazebo environment


问:
Inspect fallback --> Chrome
Can anyone tell where exactly is inspect fallback ?

chrome://inspect (Inspect fallback)

Inspect fallback should be present somewhere in chrome for inspecting devices

Title: Inspect fallback --> Chrome


问:
writing both string and json string to a csv file
I use requests to pull json files of companies. How I add a ticker column and json string in a csv file (separated by comma) so I can import the csv file into postgresql?

My python code:

```<code>ticker_list = ['AAPL','MSFT','IBM', 'APD']
    for ticker in ticker_list:
    url_profile = fmp_url + profile + ticker + '?apikey=' + apikey
    #get data in json array format
    json_array = requests.get(url_profile).json()
    # for each record within the json array, use json.dumps to turn it into an json string.
    json_str  = [json.dumps(element) for element in json_array]
    #add a ticker colum and write both ticker and json string to a csv file:
    with open ("C:\\DATA\\fmp_profile_no_brackets.csv","a") as dest:
    for element in json_str:
        dest.writelines (ticker_str + ',' + element + '\n' )
</code>```

In postgres I have table t_profile_json with 2 columns:
ticker varchar(20) and profile jsonb

when I copy the file fmp_profile into postgres by using:
copy fmp.t_profile_json(ticker,profile) from 'C:\DATA\fmp_profile.csv' delimiter ',';

I have this error:

ERROR:  extra data after last expected column
CONTEXT:  COPY t_profile_json, line 1: "AAPL,{"symbol": "AAPL", "price": 144.49, "beta": 1.219468, "volAvg": 88657734, "mktCap": 22985613828..."
SQL state: 22P04

The copy command seems to add both "AAPL, json string.." as one string.

I did something wrong at the "dest.writelines (ticker_str + ',' + element + '\n' )", but I don't know how to correct it.

Thank you so much in advance for helping!

Body:
I use requests to pull json files of companies. How I add a ticker column and json string in a csv file (separated by comma) so I can import the csv file into postgresql?

My python code:

ticker_list = ['AAPL','MSFT','IBM', 'APD']
    for ticker in ticker_list:
    url_profile = fmp_url + profile + ticker + '?apikey=' + apikey
    #get data in json array format
    json_array = requests.get(url_profile).json()
    # for each record within the json array, use json.dumps to turn it into an json string.
    json_str  = [json.dumps(element) for element in json_array]
    #add a ticker colum and write both ticker and json string to a csv file:
    with open ("C:\\DATA\\fmp_profile_no_brackets.csv","a") as dest:
    for element in json_str:
        dest.writelines (ticker_str + ',' + element + '\n' )

In postgres I have table t_profile_json with 2 columns:
ticker varchar(20) and profile jsonb

when I copy the file fmp_profile into postgres by using:
copy fmp.t_profile_json(ticker,profile) from 'C:\DATA\fmp_profile.csv' delimiter ',';

I have this error:

ERROR:  extra data after last expected column
CONTEXT:  COPY t_profile_json, line 1: "AAPL,{"symbol": "AAPL", "price": 144.49, "beta": 1.219468, "volAvg": 88657734, "mktCap": 22985613828..."
SQL state: 22P04

The copy command seems to add both "AAPL, json string.." as one string.

I did something wrong at the "dest.writelines (ticker_str + ',' + element + '\n' )", but I don't know how to correct it.

Thank you so much in advance for helping!


问:
Why does nextjs re-request an image
Hi, I'm making a slider on my site and the images are changing like this -

```<code><Image
  src={pr_list[project].src_img}
  rel="preload"
  alt="project1"
  width="1080"
  height="361"/>
</code>```

via changing the src of the image. However, when scrolling through the slider, the image is re-requested from the server and cached again. Can you tell me how to fix this? Thanks!

Title: Why does nextjs re-request an image

Body:
Hi, I'm making a slider on my site and the images are changing like this -

<Image
  src={pr_list[project].src_img}
  rel="preload"
  alt="project1"
  width="1080"
  height="361"/>

via changing the src of the image. However, when scrolling through the slider, the image is re-requested from the server and cached again. Can you tell me how to fix this? Thanks!


问:
Music player always showing timestamp for audio file
Hello I am trying to save audio file on storage, the file name is correct seeing through file manager but the music player always shows the timestamp in case of file name. I also tried other stack overflow answers that says to use DISPLAY_NAME, but it didn't work as well.

Note- When I rename that file from file manager, it starts to show correct name on music player.

`

```<code>@RequiresApi(Build.VERSION_CODES.Q)
private fun getAudioContentValues(
    context: Context,
    fileName: String,
    fileType: FileType,
    downloadPath: String
) = ContentValues().run {
    put(MediaStore.Audio.Media.DATE_ADDED, System.currentTimeMillis().toInt() / 1000)
    put(MediaStore.Audio.AudioColumns.TITLE, "file.m4a")
    put(MediaStore.Audio.AudioColumns.DISPLAY_NAME, "file.m4a")
    put(MediaStore.Audio.Media.DISPLAY_NAME, fileName)
    put(MediaStore.Audio.Media.ARTIST, context.packageName)
    put(MediaStore.Audio.Artists.ARTIST, context.packageName)
    put(MediaStore.Audio.AudioColumns.MIME_TYPE, "audio/m4a")
    put(MediaStore.Audio.AudioColumns.ARTIST, context.packageName)
    put(MediaStore.Audio.AudioColumns.ALBUM, context.packageName)
    put(MediaStore.MediaColumns.RELATIVE_PATH, downloadPath)
    context.contentResolver.insert(EXTERNAL_CONTENT_URI, this)

}
</code>```

`

This is what we see on music player.

Samsung Music or any other players

Body:
Hello I am trying to save audio file on storage, the file name is correct seeing through file manager but the music player always shows the timestamp in case of file name. I also tried other stack overflow answers that says to use DISPLAY_NAME, but it didn't work as well.

Note- When I rename that file from file manager, it starts to show correct name on music player.

`

@RequiresApi(Build.VERSION_CODES.Q)
private fun getAudioContentValues(
    context: Context,
    fileName: String,
    fileType: FileType,
    downloadPath: String
) = ContentValues().run {
    put(MediaStore.Audio.Media.DATE_ADDED, System.currentTimeMillis().toInt() / 1000)
    put(MediaStore.Audio.AudioColumns.TITLE, "file.m4a")
    put(MediaStore.Audio.AudioColumns.DISPLAY_NAME, "file.m4a")
    put(MediaStore.Audio.Media.DISPLAY_NAME, fileName)
    put(MediaStore.Audio.Media.ARTIST, context.packageName)
    put(MediaStore.Audio.Artists.ARTIST, context.packageName)
    put(MediaStore.Audio.AudioColumns.MIME_TYPE, "audio/m4a")
    put(MediaStore.Audio.AudioColumns.ARTIST, context.packageName)
    put(MediaStore.Audio.AudioColumns.ALBUM, context.packageName)
    put(MediaStore.MediaColumns.RELATIVE_PATH, downloadPath)
    context.contentResolver.insert(EXTERNAL_CONTENT_URI, this)

}

`

This is what we see on music player.

Samsung Music or any other players


问:
Downloading multiple files from S3 using flask
I am using the 'zipstream-ng' library to stream-download multiple files as a zip file from a flask server . It's a really neat solution as the server folder structure is preserved in the zip file. However I'm not able to find how / if I can use zipstreaming (or any other similar libraries) with boto3 to obtain the same result for files hosted on S3. Have searched and tried a lot without any luck. Any help appreciated!

This is my code, that works for streaming files from the server (or localhost as here). However, what I'm looking for is a way to do the same thing for files served from S3 (using boto3):

```<code>from zipstream import ZipStream

app.route('/download/')
def download():
    name = os.path.basename(os.path.abspath('C:/temp/TestFolderDownload'))
    zs.add_path("C:/temp/TestFolderDownload/File1.txt", "TestFolderDownload/File1.txt")
    zs.add_path("C:/temp/TestFolderDownload/File2.txt", "TestFolderDownload/File2.txt")
    return Response(
        zs,
        mimetype="application/zip",
        headers={
            "Content-Disposition": f"attachment; filename={name}.zip",
            "Last-Modified": zs.last_modified,
        }
    )
</code>```

Body:
I am using the 'zipstream-ng' library to stream-download multiple files as a zip file from a flask server . It's a really neat solution as the server folder structure is preserved in the zip file. However I'm not able to find how / if I can use zipstreaming (or any other similar libraries) with boto3 to obtain the same result for files hosted on S3. Have searched and tried a lot without any luck. Any help appreciated!

This is my code, that works for streaming files from the server (or localhost as here). However, what I'm looking for is a way to do the same thing for files served from S3 (using boto3):

from zipstream import ZipStream

app.route('/download/')
def download():
    name = os.path.basename(os.path.abspath('C:/temp/TestFolderDownload'))
    zs.add_path("C:/temp/TestFolderDownload/File1.txt", "TestFolderDownload/File1.txt")
    zs.add_path("C:/temp/TestFolderDownload/File2.txt", "TestFolderDownload/File2.txt")
    return Response(
        zs,
        mimetype="application/zip",
        headers={
            "Content-Disposition": f"attachment; filename={name}.zip",
            "Last-Modified": zs.last_modified,
        }
    )


问:
Unit Testing using Sinon for document.addListener
I'm doing unit test for a function with document.addEventListener

```<code>document.addEventListener('keydown', this.rfidListener, false);
</code>```

I try to use sinon.stub to mock addEventListener. But it fail to mock it. The following is my unit test mock code. But it seems like not working. Anyway for me to mock addEventListener code above???

```<code>  sinon.stub(document, 'addEventListener').value('A');
</code>```

Body:
I'm doing unit test for a function with document.addEventListener

document.addEventListener('keydown', this.rfidListener, false);

I try to use sinon.stub to mock addEventListener. But it fail to mock it. The following is my unit test mock code. But it seems like not working. Anyway for me to mock addEventListener code above???

  sinon.stub(document, 'addEventListener').value('A');


问:
How can I use element in a dataframe to locate its column head？
For this question, I want to build a rule in python: if there is a letter which equal to Z, the result will be "Service_A". Z is an element in dataframe, and "Service_A" is the name of column. So I tried to use "FOR IN” in python.

Here is my code:

```<code>Bundesliga=['A','B','C','D']
EPL=['E','F','G','H']
La_Liga=['I','J','K','L']
Ligue_1=['M','N','O','P']
RFPL=['Q','R','S','T']
Serie_A=['U','V','W','X','Y','Z']

data=pd.concat([pd.DataFrame({'Bundesliga':Bundesliga}),pd.DataFrame({'EPL': EPL}),pd.DataFrame({'La_Liga': La_Liga}),pd.DataFrame({'Ligue_1':Ligue_1}),pd.DataFrame({'RFPL':RFPL}),pd.DataFrame({'Serie_A':Serie_A})])
data.fillna(0)
print(data)

for indexs in data.index:
    for i in range(len(data.loc[indexs].values)):
        if (data.loc[indexs].values[i] =='Z'):
            print(indexs,i)
</code>```

However, I get this error:

array with more than one element is ambiguous. Use a.any() or a.all()

My question: how to use an element in a dataframe to locate its column name?

Body:
For this question, I want to build a rule in python: if there is a letter which equal to Z, the result will be "Service_A". Z is an element in dataframe, and "Service_A" is the name of column. So I tried to use "FOR IN” in python.

Here is my code:

Bundesliga=['A','B','C','D']
EPL=['E','F','G','H']
La_Liga=['I','J','K','L']
Ligue_1=['M','N','O','P']
RFPL=['Q','R','S','T']
Serie_A=['U','V','W','X','Y','Z']

data=pd.concat([pd.DataFrame({'Bundesliga':Bundesliga}),pd.DataFrame({'EPL': EPL}),pd.DataFrame({'La_Liga': La_Liga}),pd.DataFrame({'Ligue_1':Ligue_1}),pd.DataFrame({'RFPL':RFPL}),pd.DataFrame({'Serie_A':Serie_A})])
data.fillna(0)
print(data)

for indexs in data.index:
    for i in range(len(data.loc[indexs].values)):
        if (data.loc[indexs].values[i] =='Z'):
            print(indexs,i)

However, I get this error:

array with more than one element is ambiguous. Use a.any() or a.all()

My question: how to use an element in a dataframe to locate its column name?


问:
Undefined symbols for architecture x86_64 in Xcode 14.1 of New Build System
Ld /Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbLogout/BbLogout.framework/BbLogout normal (in target 'BbLogout' from project 'Pods')   cd /Users/athangamani/Documents/BB-PROJECTS/ios-bbstudent/Pods   /Applications/XCode_13/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios9.0-simulator -dynamiclib -isysroot /Applications/XCode_13/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk -L/Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbLogout -F/Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbLogout -F/Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbAppKit -F/Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbFoundation -F/Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbKit -F/Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/SDWebImage -filelist /Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/BbLogout.build/Objects-normal/x86_64/BbLogout.LinkFileList -install_name @rpath/BbLogout.framework/BbLogout -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/BbLogout.build/Objects-normal/x86_64/BbLogout_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework AVFoundation -framework BbAppKit -framework CoreGraphics -framework CoreTelephony -framework GLKit -framework OpenGLES -framework QuartzCore -framework QuickLook -framework UIKit -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/BbLogout.build/Objects-normal/x86_64/BbLogout_dependency_info.dat -o /Users/athangamani/Library/Developer/Xcode/DerivedData/BbStudent-focroldhsipukrfaflivygeqrhka/Build/Products/Debug-iphonesimulator/BbLogout/BbLogout.framework/BbLogout

Undefined symbols for architecture x86_64:  "OBJC_CLASS$_BBKAlertDialog", referenced from:    objc-class-ref in BBLOViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Without dependency will run the project


问:
On logging into multi node Gitlab via LB, this error comes: upstream connect error or upstream connect error or disconnect/reset before headers
I have created a multi node setup for GitLab. I have 3 servers for GitLab application, 1 server for external Postgres database and 1 for Redis.
I have setup the database using the following document: https://docs.gitlab.com/ee/install/installation.html#6-database

I have seeded the database as well as mentioned here: https://docs.gitlab.com/omnibus/settings/database.html#seed-the-database-fresh-installs-only

```<code>gitlab_rails[‘auto_migrate’] = false
gitlab_rails[‘db_adapter’] = “postgresql”
gitlab_rails[‘db_encoding’] = “unicode”
gitlab_rails[‘db_password’] = “database_password”
gitlab_rails[‘db_host’] = “my_db_ip”
gitlab_rails[‘db_port’] = “5432”
postgresql[‘enable’] = false
external_url ‘my_url’
</code>```

Apart from these all the lines are commented. I have configured a GCP load balancer on the 3 application servers to access my application.

Issue: I am not able to login using the load balancer. When I enter the load balancer URL, the login page is visible. When I enter the credentials, this page appears with the message:

```<code>    `upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed connect error: 111`
</code>```

error page after trying to log in

When I try accessing GitLab using the individual IP address of the servers, I can successfully login and access GitLab.
I am not sure what the issue really is. Please let me know if someone has any idea, what might be the issue. Any help will be greatly appreciated.
Thanks in Advance.

Body:
I have created a multi node setup for GitLab. I have 3 servers for GitLab application, 1 server for external Postgres database and 1 for Redis.
I have setup the database using the following document: https://docs.gitlab.com/ee/install/installation.html#6-database

I have seeded the database as well as mentioned here: https://docs.gitlab.com/omnibus/settings/database.html#seed-the-database-fresh-installs-only

gitlab_rails[‘auto_migrate’] = false
gitlab_rails[‘db_adapter’] = “postgresql”
gitlab_rails[‘db_encoding’] = “unicode”
gitlab_rails[‘db_password’] = “database_password”
gitlab_rails[‘db_host’] = “my_db_ip”
gitlab_rails[‘db_port’] = “5432”
postgresql[‘enable’] = false
external_url ‘my_url’

Apart from these all the lines are commented. I have configured a GCP load balancer on the 3 application servers to access my application.

Issue: I am not able to login using the load balancer. When I enter the load balancer URL, the login page is visible. When I enter the credentials, this page appears with the message:

    `upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed connect error: 111`

error page after trying to log in

When I try accessing GitLab using the individual IP address of the servers, I can successfully login and access GitLab.
I am not sure what the issue really is. Please let me know if someone has any idea, what might be the issue. Any help will be greatly appreciated.
Thanks in Advance.


问:
PowerBI - Show lines on a map from one point to another
We got several OLAP Cubes in PowerBI Datasets.

One of the cubes has a dimension "dim_location" which contains columns for latitude and longitude. But each dataset has 2 pairs of values, let's call them start_latitude, start_longitude and end_latitude, end_longitude.

I got a fact table connected to that dim_location and want to show some of the measures on a map.

It works perfectly fine with both the map visual and the ArcGIS visual, if I use either the end or the start coordinates. I can show the values as circles with changing size or changing color dependent on the value of a measure. So far so good.

But what I instead want to accomplish is to show a line on the map for each dataset. Each line shall go from start point to end point, color dependent on measure value.

Is there a way to offer the coordinates in the cube dimension in some string syntax that will create a shape, like a polygon with only 2 points, which would result in a line, which can then be shown on the map?

As stated before everything works fine on the map and the ArcGIS visual with one point (lat/lon) per dataset. Tried to find help online for some polygon syntax but came up empty.


问:
Using same sidekiq queue as grouped worker for different job
I'm working in Ruby on Rails(Rails 5.0)

I have a grouped sidekiq worker(GoalWorker) that groups every 100 jobs. Let the queue name be "goal_queue". Now I have an another job(say GoalEmailJob) relevant to the same model and I want to use the same queue name for this Job. But not configuring this one for grouping.

Now the documentation says

```<code>Jobs will be combined when queue size exceeds 30
</code>```

Will number of GoalEmailJob in the queue be considered for grouping criteria as it is in the same queue? Or will it consider only the number of GoalWorker in queue?

Body:
I'm working in Ruby on Rails(Rails 5.0)

I have a grouped sidekiq worker(GoalWorker) that groups every 100 jobs. Let the queue name be "goal_queue". Now I have an another job(say GoalEmailJob) relevant to the same model and I want to use the same queue name for this Job. But not configuring this one for grouping.

Now the documentation says

Jobs will be combined when queue size exceeds 30

Will number of GoalEmailJob in the queue be considered for grouping criteria as it is in the same queue? Or will it consider only the number of GoalWorker in queue?


问:
How to fix - undefined method `register' for Middleman::PhpExtension:Class (NoMethodError)?
I'm trying to update middleman version(3.4.1 -> 4.4.3) in my project. I'm using bundle version(2.3.26), and ruby(2.7.7). After upgrading when trying to run - bundle exec middleman, I'm getting the below error. My project is in macos system.

```<code>bundler: failed to load command: middleman (/Users/suparna.dey/Dev/ProjectB/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman)
Traceback (most recent call last):
    27: from /opt/homebrew/opt/ruby@2.7/bin/bundle:23:in `<main>'
    26: from /opt/homebrew/opt/ruby@2.7/bin/bundle:23:in `load'
    25: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
    24: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
    23: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
    22: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
    21: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    20: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
    19: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    18: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    17: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    16: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
    15: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
    14: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
    13: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
    12: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman:25:in `<top (required)>'
    11: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman:25:in `load'
    10: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-cli-4.4.3/bin/middleman:10:in `<top (required)>'
     9: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.4.3/lib/middleman-core/load_paths.rb:15:in `setup_load_paths'
     8: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.4.3/lib/middleman-core/load_paths.rb:35:in `setup_bundler'
     7: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler.rb:186:in `require'
     6: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `require'
     5: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `each'
     4: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `block in require'
     3: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `each'
     2: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
     1: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in `require'
/Users/suparna.dey/Dev/ProjectB/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bundler/gems/middleman-php-b4a6864f4a91/lib/middleman-php.rb:4:in `<top (required)>': undefined method `register' for Middleman::PhpExtension:Class (NoMethodError)
</code>```

Body:
I'm trying to update middleman version(3.4.1 -> 4.4.3) in my project. I'm using bundle version(2.3.26), and ruby(2.7.7). After upgrading when trying to run - bundle exec middleman, I'm getting the below error. My project is in macos system.

bundler: failed to load command: middleman (/Users/suparna.dey/Dev/ProjectB/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman)
Traceback (most recent call last):
    27: from /opt/homebrew/opt/ruby@2.7/bin/bundle:23:in `'
    26: from /opt/homebrew/opt/ruby@2.7/bin/bundle:23:in `load'
    25: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
    24: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
    23: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
    22: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
    21: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    20: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
    19: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    18: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    17: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    16: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
    15: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
    14: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
    13: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
    12: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman:25:in `<top (required)>'
    11: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman:25:in `load'
    10: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-cli-4.4.3/bin/middleman:10:in `<top (required)>'
     9: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.4.3/lib/middleman-core/load_paths.rb:15:in `setup_load_paths'
     8: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.4.3/lib/middleman-core/load_paths.rb:35:in `setup_bundler'
     7: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler.rb:186:in `require'
     6: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `require'
     5: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in `each'
     4: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `block in require'
     3: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in `each'
     2: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
     1: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in `require'
/Users/suparna.dey/Dev/ProjectB/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bundler/gems/middleman-php-b4a6864f4a91/lib/middleman-php.rb:4:in `<top (required)>': undefined method `register' for Middleman::PhpExtension:Class (NoMethodError)


问:
Generate online page thumbnails for website using API or Framework in javascript
How pages generate page thumbnails for their internal resources?

A framework or javascript api that generates.


问:
What is the correct encoding to read and write PostScript files
I would like to parse a PostScript file, find appropriate line number and insert a PostScript command. So, I need to read the whole file and write it as a new file along with the new commands I want to insert.

I'm using StreamReader and StreamWriter for this process.

StreamReader sr = new StreamReader("filename.ps", System.Text.Encoding.UTF8, true);

StreamWriter sw = new StreamWriter("updatedfilename.ps",true, System.Text.Encoding.UTF8);

When doing this, even though the commands are inserted in the appropriate location, some characters are getting lost due to encoding issues.

For example, please check the below image: In the After content, you can notice the yellow highlighted characters which got added during my write process.

In summary, I would like to know the process to read and write a PS file as it is without losing data because of encoding.


问:
tcl - excel. change font of cell
please help me find examples of working with the font of the text in the Excel cell in the TCL code. Turn on Border Bottom and use underline the text. Screenshot of the parameters I need to change below.
I found examples enter link description here but not exactly for underline the text

Thanks a lot

Title: tcl - excel. change font of cell


问:
Is there a way to dynamically import a Vue component from the Laravel/Inertia backend based on a successful authentication check?
In an application with user profiles where a user can view information about themselves, I would like to add a 'Delete this user' button that only appears for logged-in admin users.

Using Inertia, I can check a user is an admin on the backend, then serve the page with return inertia('Page', [admin => true]); in the page data, and render the button based on that boolean.

My concern is that if there is sensitive information in the component that should only be shown to admins (let's say, in this example, I don't want users to know an admin can delete their account), a user has still downloaded that component when they loaded the page which imports it, even if through normal usage it would not be rendered into their DOM.

How can we get around this issue? Is it possible to entirely hide the existence of a Vue 3 component behind an authentication gate when using Laravel & InertiaJS?

For example, if I wanted to hide all evidence of the button in an application using blade for layout, I might do:

```<code>@if($admin === true)
<button onClick="http://my-secret-url.com/">Delete user</button>
@endif
</code>```

Which doesn't provide the user with an opportunity to intercept the response from the server and change the 'admin' variable to true in order to see the button.

Body:
In an application with user profiles where a user can view information about themselves, I would like to add a 'Delete this user' button that only appears for logged-in admin users.

Using Inertia, I can check a user is an admin on the backend, then serve the page with return inertia('Page', [admin => true]); in the page data, and render the button based on that boolean.

My concern is that if there is sensitive information in the component that should only be shown to admins (let's say, in this example, I don't want users to know an admin can delete their account), a user has still downloaded that component when they loaded the page which imports it, even if through normal usage it would not be rendered into their DOM.

How can we get around this issue? Is it possible to entirely hide the existence of a Vue 3 component behind an authentication gate when using Laravel & InertiaJS?

For example, if I wanted to hide all evidence of the button in an application using blade for layout, I might do:

@if($admin === true)
<button onClick="http://my-secret-url.com/">Delete user</button>
@endif

Which doesn't provide the user with an opportunity to intercept the response from the server and change the 'admin' variable to true in order to see the button.


问:
Error while building confluent-kafka in docker for alphine image
I am trying to build a python application which require confluent-kafka package. But while building in bamboo, I got the below error

```<code>fatal error: librdkafka/rdkafka.h: No such file or directory
build   13-Dec-2022 11:46:59             23 | #include <librdkafka/rdkafka.h>
build   13-Dec-2022 11:46:59                |          ^~~~~~~~~~~~~~~~~~~~~~
</code>```

My dockerfile is as such:

```<code>FROM python:3.9-alpine

RUN adduser -D pythonwebapi

WORKDIR /home/pythonwebapi
COPY requirements.txt requirements.txt
COPY logger_config.py logger_config.py
RUN echo 'http://dl-3.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories

RUN apk update \
    && apk upgrade \
    && apk add --no-cache build-base \
        autoconf \
        bash \
        bison \
        boost-dev \
        cmake \
        flex \
        # libressl-dev \
        zlib-dev

RUN  apk add make gcc g++
RUN apk add libffi-dev
RUN apk update && apk --no-cache add librdkafka-dev
RUN apk add postgresql-dev gcc python3-dev musl-dev
RUN pip install --upgrade pip && pip install -r requirements.txt && pip install gunicorn
RUN apk del gcc g++ make

RUN pip install --no-cache-dir six pytest numpy cython
RUN pip install --no-cache-dir pandas
RUN pip install --no-cache-dir confluent-kafka

ARG ARROW_VERSION=3.0.0
ARG ARROW_SHA1=c1fed962cddfab1966a0e03461376ebb28cf17d3
ARG ARROW_BUILD_TYPE=release

ENV ARROW_HOME=/usr/local \
    PARQUET_HOME=/usr/local

#Download and build apache-arrow
RUN mkdir -p /arrow \
    && wget -q https://github.com/apache/arrow/archive/apache-arrow-${ARROW_VERSION}.tar.gz -O /tmp/apache-arrow.tar.gz \
    && echo "${ARROW_SHA1} *apache-arrow.tar.gz" | sha1sum /tmp/apache-arrow.tar.gz \
    && tar -xvf /tmp/apache-arrow.tar.gz -C /arrow --strip-components 1 \
    && mkdir -p /arrow/cpp/build \
    && cd /arrow/cpp/build \
    && cmake -DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \
        -DOPENSSL_ROOT_DIR=/usr/local/ssl \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
        -DARROW_WITH_BZ2=ON \
        -DARROW_WITH_ZLIB=ON \
        -DARROW_WITH_ZSTD=ON \
        -DARROW_WITH_LZ4=ON \
        -DARROW_WITH_SNAPPY=ON \
        -DARROW_PARQUET=ON \
        -DARROW_PYTHON=ON \
        -DARROW_PLASMA=ON \
        -DARROW_BUILD_TESTS=OFF \
        .. \
    && make -j$(nproc) \
    && make install \
    && cd /arrow/python \
    && python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --with-parquet \
    && python setup.py install \
    && rm -rf /arrow /tmp/apache-arrow.tar.gz

COPY app app
COPY init_app.py ./

ENV FLASK_APP init_app.py

RUN chown -R pythonwebapi:pythonwebapi ./
RUN chown -R 777 ./
USER pythonwebapi

EXPOSE 8000 7000
ENTRYPOINT ["gunicorn","--timeout", "7000","init_app:app","-k","uvicorn.workers.UvicornWorker","-b","0.0.0.0"]
</code>```

I am unable to gauge why the error is coming since librdkafka is already installed.My requirement is to use alpine image. Can anyone please help me regarding this?

Body:
I am trying to build a python application which require confluent-kafka package. But while building in bamboo, I got the below error

fatal error: librdkafka/rdkafka.h: No such file or directory
build   13-Dec-2022 11:46:59             23 | #include <librdkafka/rdkafka.h>
build   13-Dec-2022 11:46:59                |          ^~~~~~~~~~~~~~~~~~~~~~

My dockerfile is as such:

FROM python:3.9-alpine

RUN adduser -D pythonwebapi

WORKDIR /home/pythonwebapi
COPY requirements.txt requirements.txt
COPY logger_config.py logger_config.py
RUN echo 'http://dl-3.alpinelinux.org/alpine/v3.9/main' >> /etc/apk/repositories

RUN apk update \
    && apk upgrade \
    && apk add --no-cache build-base \
        autoconf \
        bash \
        bison \
        boost-dev \
        cmake \
        flex \
        # libressl-dev \
        zlib-dev

RUN  apk add make gcc g++
RUN apk add libffi-dev
RUN apk update && apk --no-cache add librdkafka-dev
RUN apk add postgresql-dev gcc python3-dev musl-dev
RUN pip install --upgrade pip && pip install -r requirements.txt && pip install gunicorn
RUN apk del gcc g++ make

RUN pip install --no-cache-dir six pytest numpy cython
RUN pip install --no-cache-dir pandas
RUN pip install --no-cache-dir confluent-kafka

ARG ARROW_VERSION=3.0.0
ARG ARROW_SHA1=c1fed962cddfab1966a0e03461376ebb28cf17d3
ARG ARROW_BUILD_TYPE=release

ENV ARROW_HOME=/usr/local \
    PARQUET_HOME=/usr/local

#Download and build apache-arrow
RUN mkdir -p /arrow \
    && wget -q https://github.com/apache/arrow/archive/apache-arrow-${ARROW_VERSION}.tar.gz -O /tmp/apache-arrow.tar.gz \
    && echo "${ARROW_SHA1} *apache-arrow.tar.gz" | sha1sum /tmp/apache-arrow.tar.gz \
    && tar -xvf /tmp/apache-arrow.tar.gz -C /arrow --strip-components 1 \
    && mkdir -p /arrow/cpp/build \
    && cd /arrow/cpp/build \
    && cmake -DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \
        -DOPENSSL_ROOT_DIR=/usr/local/ssl \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
        -DARROW_WITH_BZ2=ON \
        -DARROW_WITH_ZLIB=ON \
        -DARROW_WITH_ZSTD=ON \
        -DARROW_WITH_LZ4=ON \
        -DARROW_WITH_SNAPPY=ON \
        -DARROW_PARQUET=ON \
        -DARROW_PYTHON=ON \
        -DARROW_PLASMA=ON \
        -DARROW_BUILD_TESTS=OFF \
        .. \
    && make -j$(nproc) \
    && make install \
    && cd /arrow/python \
    && python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --with-parquet \
    && python setup.py install \
    && rm -rf /arrow /tmp/apache-arrow.tar.gz

COPY app app
COPY init_app.py ./

ENV FLASK_APP init_app.py

RUN chown -R pythonwebapi:pythonwebapi ./
RUN chown -R 777 ./
USER pythonwebapi

EXPOSE 8000 7000
ENTRYPOINT ["gunicorn","--timeout", "7000","init_app:app","-k","uvicorn.workers.UvicornWorker","-b","0.0.0.0"]

I am unable to gauge why the error is coming since librdkafka is already installed.My requirement is to use alpine image. Can anyone please help me regarding this?


问:
Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory"
I am trying to establish a connection from Azure pipelines to oracle using cx_oracle.

I'm using a Dockerfile:

```<code>FROM python:3.9-slim-buster

RUN apt-get update && apt-get install -y git && apt-get install telnet
RUN apt-get install -y gcc
RUN apt-get -y install wget
RUN apt -y install unzip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-basic-linux.x64-21.5.0.0.0dbru.zip
RUN unzip instantclient-basic-linux.x64-21.5.0.0.0dbru.zip
RUN apt-get -y install libaio1
RUN sh -c "echo /instantclient_21_5 > /etc/ld.so.conf.d/oracle-instantclient.conf"
RUN ldconfig
RUN apt -y remove unzip
RUN rm instantclient-basic-linux.x64-21.5.0.0.0dbru.zip

CMD ["/bin/sh"]
</code>```

Im doing automated tests using robotframework, i just updated to cx-Oracle 8.3.0. I still get the error

```<code>DatabaseError: DPI-1047:
Cannot locate a 64-bit Oracle Client library:
"libclntsh.so: cannot open shared object file:
No such file or directory".
</code>```

Body:
I am trying to establish a connection from Azure pipelines to oracle using cx_oracle.

I'm using a Dockerfile:

FROM python:3.9-slim-buster

RUN apt-get update && apt-get install -y git && apt-get install telnet
RUN apt-get install -y gcc
RUN apt-get -y install wget
RUN apt -y install unzip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-basic-linux.x64-21.5.0.0.0dbru.zip
RUN unzip instantclient-basic-linux.x64-21.5.0.0.0dbru.zip
RUN apt-get -y install libaio1
RUN sh -c "echo /instantclient_21_5 > /etc/ld.so.conf.d/oracle-instantclient.conf"
RUN ldconfig
RUN apt -y remove unzip
RUN rm instantclient-basic-linux.x64-21.5.0.0.0dbru.zip

CMD ["/bin/sh"]

Im doing automated tests using robotframework, i just updated to cx-Oracle 8.3.0. I still get the error

DatabaseError: DPI-1047:
Cannot locate a 64-bit Oracle Client library:
"libclntsh.so: cannot open shared object file:
No such file or directory".


问:
Log4j2 not deleting the files with DeleteAction
```<code>PathCondition[] pathConditions = new PathCondition[]{IfAccumulatedFileCount.createFileCountCondition(5)};
        String basePath = sRolloverPattern.substring(0, sRolloverPattern.lastIndexOf(File.separator));
        DeleteAction deleteAction = DeleteAction.createDeleteAction(basePath, true, 1, true, null, pathConditions, null, config);

        DefaultRolloverStrategy strategy = DefaultRolloverStrategy.newBuilder()
                .withConfig(config).withMax(String.valueOf("3"))
                .withCustomActions(new Action[]{deleteAction}).build();
</code>```

Please advice as it's still keeping 3 files for 1st day and next day again 3 files. The file is not getting deleted accordingly mainiting 5 log files.

Please advice what changes need to be done?

Body:
PathCondition[] pathConditions = new PathCondition[]{IfAccumulatedFileCount.createFileCountCondition(5)};
        String basePath = sRolloverPattern.substring(0, sRolloverPattern.lastIndexOf(File.separator));
        DeleteAction deleteAction = DeleteAction.createDeleteAction(basePath, true, 1, true, null, pathConditions, null, config);

        DefaultRolloverStrategy strategy = DefaultRolloverStrategy.newBuilder()
                .withConfig(config).withMax(String.valueOf("3"))
                .withCustomActions(new Action[]{deleteAction}).build();

Please advice as it's still keeping 3 files for 1st day and next day again 3 files. The file is not getting deleted accordingly mainiting 5 log files.

Please advice what changes need to be done?


Title: Group rows with common id in pyspark

Body:
I try to analyze the number of combinations with the same label but in different periods.

from pyspark.sql.functions import *
from pyspark.sql.functions import last
from pyspark.sql.functions import arrays_zip
from pyspark.sql.types import *
from pyspark.sql import *

data  = [["1", "2022-06-01 00:00:04.437000+02:00", "c", "A", "8", "6"],
        ["2", "2022-06-01 00:00:04.625000+02:00", "e", "A", "4", "2"],
        ["3", "2022-06-01 00:00:04.640000+02:00", "b", "A", "5", "3"],
        ["4", "2022-06-01 00:00:04.640000+02:00", "a", "A", "1", "6"],
       ["1", "2022-06-01 00:00:04.669000+02:00", "c", "B", "2", "4"],
        ["5", "2022-06-01 00:00:05.223000+02:00", "b", "B", "6", "8"],

       ["6", "2022-06-01 00:00:05.599886+02:00", "c", "A", None, "9"],
       ["1", "2022-06-01 00:00:05.740886+02:00", "b", "A", "8", "6"],
        ["2", "2022-06-01 00:00:05.937000+02:00", "a", "A", "4", "2"],
        ["3", "2022-06-01 00:00:05.937000+02:00", "e", "A", "5", "3"],
        ["4", "2022-06-01 00:00:30.746501-05:00", "b", "C", "1", "6"],
        ["1", "2022-06-01 00:00:30.747498-05:00", "d", "C", "2", "4"],

        ["5", "2022-06-01 00:00:30.789820+02:00", "b", "D", "6", "8"],
       ["6", "2022-06-01 00:00:31.062000+02:00", "e", "E", None, "9"],
       ["1", "2022-06-01 00:00:31.078000+02:00", "b", "E", "8", "6"],
        ["2", "2022-06-01 00:00:31.078000+02:00", "a", "F", "4", "2"],
       ["3", "2022-06-01 00:00:31.861017+02:00", "c", "G", "5", "3"],
        ["4", "2022-06-01 00:00:32.205639+00:00", "b", "H", "1", "6"],

        ["1", "2022-06-01 00:00:34.656000+02:00", "b", "I", "2", "4"],
        ["5", "2022-06-01 00:00:34.656000+02:00", "a", "I", "6", "8"],
       ["6", "2022-06-01 00:00:34.656000+02:00", "e", "I", None, "9"]]

columns = ['ID', 'source_timestamp', 'node_id', 'cd_equipment_no', 'x', 'y']

dataframe = spark.createDataFrame(data, columns)
dataframe = dataframe.withColumn("source_timestamp", to_timestamp(col("source_timestamp")))

This is how the data looks like

+---+--------------------+-------+---------------+----+---+
| ID|    source_timestamp|node_id|cd_equipment_no|   x|  y|
+---+--------------------+-------+---------------+----+---+
|  1|2022-05-31 22:00:...|      c|              A|   8|  6|
|  2|2022-05-31 22:00:...|      e|              A|   4|  2|
|  3|2022-05-31 22:00:...|      b|              A|   5|  3|
|  4|2022-05-31 22:00:...|      a|              A|   1|  6|
|  1|2022-05-31 22:00:...|      c|              B|   2|  4|
|  5|2022-05-31 22:00:...|      b|              B|   6|  8|
|  6|2022-05-31 22:00:...|      c|              A|null|  9|
|  1|2022-05-31 22:00:...|      b|              A|   8|  6|
|  2|2022-05-31 22:00:...|      a|              A|   4|  2|
|  3|2022-05-31 22:00:...|      e|              A|   5|  3|
|  4|2022-06-01 05:00:...|      b|              C|   1|  6|
|  1|2022-06-01 05:00:...|      d|              C|   2|  4|
|  5|2022-05-31 22:00:...|      b|              D|   6|  8|
|  6|2022-05-31 22:00:...|      e|              E|null|  9|
|  1|2022-05-31 22:00:...|      b|              E|   8|  6|
|  2|2022-05-31 22:00:...|      a|              F|   4|  2|
|  3|2022-05-31 22:00:...|      c|              G|   5|  3|
|  4|2022-06-01 00:00:...|      b|              H|   1|  6|
|  1|2022-05-31 22:00:...|      b|              I|   2|  4|
|  5|2022-05-31 22:00:...|      a|              I|   6|  8|
+---+--------------------+-------+---------------+----+---+

My intention is to create an identifier when the time is sorted ascending based on source_timestamp

This is what I get

window = Window.partitionBy('cd_equipment_no').orderBy(col('source_timestamp'))

dataframe = dataframe.select('*', row_number().over(window).alias('posicion'))
+---+--------------------+-------+---------------+----+---+--------+--------+
| ID|    source_timestamp|node_id|cd_equipment_no|   x|  y|posicion|posicion|
+---+--------------------+-------+---------------+----+---+--------+--------+
|  1|2022-05-31 22:00:...|      c|              A|   8|  6|       1|       1|
|  2|2022-05-31 22:00:...|      e|              A|   4|  2|       2|       2|
|  3|2022-05-31 22:00:...|      b|              A|   5|  3|       3|       3|
|  4|2022-05-31 22:00:...|      a|              A|   1|  6|       4|       4|
|  6|2022-05-31 22:00:...|      c|              A|null|  9|       7|       5|
|  1|2022-05-31 22:00:...|      b|              A|   8|  6|       8|       6|
|  2|2022-05-31 22:00:...|      a|              A|   4|  2|       9|       7|
|  3|2022-05-31 22:00:...|      e|              A|   5|  3|      10|       8|
|  1|2022-05-31 22:00:...|      c|              B|   2|  4|       5|       1|
|  5|2022-05-31 22:00:...|      b|              B|   6|  8|       6|       2|
|  4|2022-06-01 05:00:...|      b|              C|   1|  6|      20|       1|
|  1|2022-06-01 05:00:...|      d|              C|   2|  4|      21|       2|
|  5|2022-05-31 22:00:...|      b|              D|   6|  8|      11|       1|
|  6|2022-05-31 22:00:...|      e|              E|null|  9|      12|       1|
|  1|2022-05-31 22:00:...|      b|              E|   8|  6|      13|       2|
|  2|2022-05-31 22:00:...|      a|              F|   4|  2|      14|       1|
|  3|2022-05-31 22:00:...|      c|              G|   5|  3|      15|       1|
|  4|2022-06-01 00:00:...|      b|              H|   1|  6|      19|       1|
|  1|2022-05-31 22:00:...|      b|              I|   2|  4|      16|       1|
|  5|2022-05-31 22:00:...|      a|              I|   6|  8|      17|       2|
+---+--------------------+-------+---------------+----+---+--------+--------+

And this is what I want

+---+--------------------+-------+---------------+----+---+--------+--------+
| ID|    source_timestamp|node_id|cd_equipment_no|   x|  y|posicion|posicion|
+---+--------------------+-------+---------------+----+---+--------+--------+
|  1|2022-05-31 22:00:...|      c|              A|   8|  6|       1|       1|
|  2|2022-05-31 22:00:...|      e|              A|   4|  2|       2|       2|
|  3|2022-05-31 22:00:...|      b|              A|   5|  3|       3|       3|
|  4|2022-05-31 22:00:...|      a|              A|   1|  6|       4|       4|
|  6|2022-05-31 22:00:...|      c|              A|null|  9|       7|       1|
|  1|2022-05-31 22:00:...|      b|              A|   8|  6|       8|       2|
|  2|2022-05-31 22:00:...|      a|              A|   4|  2|       9|       3|
|  3|2022-05-31 22:00:...|      e|              A|   5|  3|      10|       4|
|  1|2022-05-31 22:00:...|      c|              B|   2|  4|       5|       1|
|  5|2022-05-31 22:00:...|      b|              B|   6|  8|       6|       2|
|  4|2022-06-01 05:00:...|      b|              C|   1|  6|      20|       1|
|  1|2022-06-01 05:00:...|      d|              C|   2|  4|      21|       2|
|  5|2022-05-31 22:00:...|      b|              D|   6|  8|      11|       1|
|  6|2022-05-31 22:00:...|      e|              E|null|  9|      12|       1|
|  1|2022-05-31 22:00:...|      b|              E|   8|  6|      13|       2|
|  2|2022-05-31 22:00:...|      a|              F|   4|  2|      14|       1|
|  3|2022-05-31 22:00:...|      c|              G|   5|  3|      15|       1|
|  4|2022-06-01 00:00:...|      b|              H|   1|  6|      19|       1|
|  1|2022-05-31 22:00:...|      b|              I|   2|  4|      16|       1|
|  5|2022-05-31 22:00:...|      a|              I|   6|  8|      17|       2|
+---+--------------------+-------+---------------+----+---+--------+--------+


问:
differing inline functions in separate translation units
Suppose I have two inline functions with identical signatures but differing implementations, for example

```<code>inline int op(int x, int y) { return x + y; }
</code>```

and

```<code>inline int op(int x, int y) { return x - y; }
</code>```

Now suppose the first inline function appears in one translation unit and the second in a different translation unit, and there is no other occurrence of either function in any other translation unit.

Is this situation any kind of error (maybe an ODR error)? And if it is are compilers/linkers required to diagnose this error?

Body:
Suppose I have two inline functions with identical signatures but differing implementations, for example

inline int op(int x, int y) { return x + y; }

and

inline int op(int x, int y) { return x - y; }

Now suppose the first inline function appears in one translation unit and the second in a different translation unit, and there is no other occurrence of either function in any other translation unit.

Is this situation any kind of error (maybe an ODR error)? And if it is are compilers/linkers required to diagnose this error?


问:
Multiple For Each in Terraform
I am trying to deploy multiple for_each in terraform. I have two variables:

variable "VirtualNetworks" is for two VLANS, deployed in two different locations.

variable "VirtualMachines" is for six VM's, 3 in each of the VLANS.

Following are variable types:

```<code>variable "VirtualNetworks" {
  type = list(object({
    VirtualNetworksName     = string
    VirtualNetworksLocation = string
    SubnetName              = string
    NGSName                 = string
  }))...}

variable "VirtualMachines" {
  type = list(object({
    OS          = string
    location    = string
    hostname    = string
    interfaceid = string
    size        = string
    environment = string
    publisher   = string
    offer       = string
    sku         = string
    version     = string
  }))...}
</code>```

The issue is when I am trying to assign 6 network interfaces dynamically, I don't know how to. Following is the way I have tried.

```<code>resource "azurerm_network_interface" "tf_example_nic" {

  for_each = { for i, v in var.VirtualMachines : i => v }
  # for_each = { for j, w in var.VirtualNetworks : j => w }

  name                = each.value.interfaceid
  location            = each.value.location
  resource_group_name = azurerm_resource_group.tf_example_rg.name

  ip_configuration {
    name      = "internal"
    subnet_id = each.key != "0||1||2" ? azurerm_subnet.tf_example_subnet[0].id : azurerm_subnet.tf_example_subnet[1].id
    # subnet_id                     = azurerm_subnet.tf_example_subnet[each.key].id
    private_ip_address_allocation = "Dynamic"
    public_ip_address_id          = azurerm_public_ip.tf_example_public_ip[each.key].id
  }

}
</code>```

Is there a way I can try and make this dynamic. Any assistance will be really helpful.

Title: Multiple For Each in Terraform

Body:
I am trying to deploy multiple for_each in terraform. I have two variables:

variable "VirtualNetworks" is for two VLANS, deployed in two different locations.

variable "VirtualMachines" is for six VM's, 3 in each of the VLANS.

Following are variable types:

variable "VirtualNetworks" {
  type = list(object({
    VirtualNetworksName     = string
    VirtualNetworksLocation = string
    SubnetName              = string
    NGSName                 = string
  }))...}

variable "VirtualMachines" {
  type = list(object({
    OS          = string
    location    = string
    hostname    = string
    interfaceid = string
    size        = string
    environment = string
    publisher   = string
    offer       = string
    sku         = string
    version     = string
  }))...}

The issue is when I am trying to assign 6 network interfaces dynamically, I don't know how to. Following is the way I have tried.

resource "azurerm_network_interface" "tf_example_nic" {

  for_each = { for i, v in var.VirtualMachines : i => v }
  # for_each = { for j, w in var.VirtualNetworks : j => w }

  name                = each.value.interfaceid
  location            = each.value.location
  resource_group_name = azurerm_resource_group.tf_example_rg.name

  ip_configuration {
    name      = "internal"
    subnet_id = each.key != "0||1||2" ? azurerm_subnet.tf_example_subnet[0].id : azurerm_subnet.tf_example_subnet[1].id
    # subnet_id                     = azurerm_subnet.tf_example_subnet[each.key].id
    private_ip_address_allocation = "Dynamic"
    public_ip_address_id          = azurerm_public_ip.tf_example_public_ip[each.key].id
  }

}

Is there a way I can try and make this dynamic. Any assistance will be really helpful.


问:
Unwrapping hyperlink from anchor tag using jQuery
I need to remove/unwrap hyperlinks from below element if the value is -

```<code> $('span.name', this).after(`<span class="service-tier table-item-tier"><a class='service-link' href="https://link?search=${appName}" target="_blank" onclick="event.stopPropagation()">${selectedApp?.tier || '-'}</a></span>`);

</code>```

I'm able to solve this using

```<code>$('.service-link').each(function () {
  var tag = $(this).html();
  if (tag == '-')
  {
    $(this).contents().unwrap();
  }
});
</code>```

Is there any other efficient way to solve the problem, I feel I'm unnecessarily looping through instead of applying required logic in above code.

Body:
I need to remove/unwrap hyperlinks from below element if the value is -

 $('span.name', this).after(`<span class="service-tier table-item-tier"><a class='service-link' href="https://link?search=${appName}" target="_blank" onclick="event.stopPropagation()">${selectedApp?.tier || '-'}</a></span>`);

I'm able to solve this using

$('.service-link').each(function () {
  var tag = $(this).html();
  if (tag == '-')
  {
    $(this).contents().unwrap();
  }
});

Is there any other efficient way to solve the problem, I feel I'm unnecessarily looping through instead of applying required logic in above code.


问:
Insert into two tables simultaneously, using **ID**(primary key, auto increment) from first table to store data on second table
I need to store data on two tables simultaneously.

with first table window having columns (ID, start_time, stop_time, message) and second table windowClients having columns (ID, Clients).

ID is auto-incremented in table window, i want to insert 'Clients' into windowClients with that same ID.

window

ID
start_time
stop_time
message

100
2022-12-03 15:13:00
2022-10-03 15:13:00
hello

101
2022-10-15 13:10:00
2022-10-03 15:13:00
test

windowClients

ID
Clients

100
443

100
147

100
600

101
556

101
555

How should i insert the following data in both of two tables at the same time:

```<code>start_time : 2022-12-25 11:11:00
stop_time  : 2022-10-26 11:11:00
message    : Holiday timeout
Clients    : 256, 727, 600, 535
</code>```

i can do the following but it's probably not a good way.

Insert into window (columns) values (value)

Insert into windowClients (ID, Clients)  values ((select max(ID) from window), (443))

Body:
I need to store data on two tables simultaneously.

with first table window having columns (ID, start_time, stop_time, message) and second table windowClients having columns (ID, Clients).

ID is auto-incremented in table window, i want to insert 'Clients' into windowClients with that same ID.

window

ID
start_time
stop_time
message

100
2022-12-03 15:13:00
2022-10-03 15:13:00
hello

101
2022-10-15 13:10:00
2022-10-03 15:13:00
test

windowClients

ID
Clients

100
443

100
147

100
600

101
556

101
555

How should i insert the following data in both of two tables at the same time:

start_time : 2022-12-25 11:11:00
stop_time  : 2022-10-26 11:11:00
message    : Holiday timeout
Clients    : 256, 727, 600, 535

i can do the following but it's probably not a good way.

Insert into window (columns) values (value)

Insert into windowClients (ID, Clients)  values ((select max(ID) from window), (443))


问:
How to get distance from bottom of screen to a particular widget in flutter web?
I need to calculate the distance from the bottom of a screen to a container.Is it possible to calculate distance from bottom of a screen to Container and distance from top of a screen to container in separately?

I got the distance from top like this,

```<code> RenderBox box = keyGlobal.currentContext!.findRenderObject() as RenderBox;
              Offset position = box.localToGlobal(Offset.zero); //this is global position
              double y = position.dy;
</code>```

Is it possible to get distance from bottom?

Body:
I need to calculate the distance from the bottom of a screen to a container.Is it possible to calculate distance from bottom of a screen to Container and distance from top of a screen to container in separately?

I got the distance from top like this,

 RenderBox box = keyGlobal.currentContext!.findRenderObject() as RenderBox;
              Offset position = box.localToGlobal(Offset.zero); //this is global position
              double y = position.dy;

Is it possible to get distance from bottom?


问:
X-axis plotting in the wrong place
all. I'm trying to make a plot, whereby the data for x-axis is in a list of dates all written as strings in the format "yyyy-mm-dd". Now I'm trying to plot for dates that are all in November. On the 18th of November a change was made and so I've draw a line on the plot for the date and I'm trying to compare data that should be on either side of the line. The problem is that the data points for the 18th of November, along with the line, seem to appear at either the beginning of x-axis for some plots, and at the end of the x-axis for other plots, without any rhyme or reason, as far as I can tell, even though the 18th of November is supposed to show up in the middle of the month.

What's confusing me even further is that I've done these plots before with data going from October to December, and for the most part the plots come out fine. All I've changed since is only plotting dates from November, could anyone possible know what might cause this?

To be honest, I've been struggling to come up with theories as to why this could be happening, so I have no idea how to even test what could be the cause of the problem.

Here is my code, sorry that it's so long, but I figured I should give a holistic context:

```<code>1mon = "-11-"
for j in range(len(badDestinations)):

        BDestination = badDestinations[j]["destination"]
        Time = badDestinations[j]["time"]

7       year, month, date = day.partition(mon)

9       if month == mon:

            if BDestination == "Burns":
                Burns.append(Time)
                Burnsday.append(day)

        for k in range(len(goodDestinations)):

            GDestination = goodDestinations[k]["destination"]
            Time = goodDestinations[k]["time"]

21          year, month, date = day.partition(mon)

23          if month == mon:

                if GDestination == "Burns":
                    Burns.append(Time)
                    Burnsday.append(day)

Burns.reverse()
Burnsday.reverse()

from matplotlib.pyplot import plot as plt
from matplotlib.pyplot import figure, xlabel, ylabel, title
%matplotlib qt5

#Burns graph
figure(1)
title('Burns Unit Wait times')
plt(Burnsday,Burns)
plt(["2022-11-18","2022-11-18"],[0,max(Burns)], 'r--')
xlabel('Day')
ylabel('Waiting time')
</code>```

The only thing that I've changed from the .py file analyzing data from October-December to the one only analyzing November are adding in lines 1, 7, 9, 21, and 23, (I've written the numbers of these lines at the beginning of each respective line) along with the indentations that would be required for the loops associated with those lines.

Title: X-axis plotting in the wrong place

Body:
all. I'm trying to make a plot, whereby the data for x-axis is in a list of dates all written as strings in the format "yyyy-mm-dd". Now I'm trying to plot for dates that are all in November. On the 18th of November a change was made and so I've draw a line on the plot for the date and I'm trying to compare data that should be on either side of the line. The problem is that the data points for the 18th of November, along with the line, seem to appear at either the beginning of x-axis for some plots, and at the end of the x-axis for other plots, without any rhyme or reason, as far as I can tell, even though the 18th of November is supposed to show up in the middle of the month.

What's confusing me even further is that I've done these plots before with data going from October to December, and for the most part the plots come out fine. All I've changed since is only plotting dates from November, could anyone possible know what might cause this?

To be honest, I've been struggling to come up with theories as to why this could be happening, so I have no idea how to even test what could be the cause of the problem.

Here is my code, sorry that it's so long, but I figured I should give a holistic context:

1mon = "-11-"
for j in range(len(badDestinations)):

        BDestination = badDestinations[j]["destination"]
        Time = badDestinations[j]["time"]

7       year, month, date = day.partition(mon)

9       if month == mon:

            if BDestination == "Burns":
                Burns.append(Time)
                Burnsday.append(day)

        for k in range(len(goodDestinations)):

            GDestination = goodDestinations[k]["destination"]
            Time = goodDestinations[k]["time"]

21          year, month, date = day.partition(mon)

23          if month == mon:

                if GDestination == "Burns":
                    Burns.append(Time)
                    Burnsday.append(day)

Burns.reverse()
Burnsday.reverse()

from matplotlib.pyplot import plot as plt
from matplotlib.pyplot import figure, xlabel, ylabel, title
%matplotlib qt5

#Burns graph
figure(1)
title('Burns Unit Wait times')
plt(Burnsday,Burns)
plt(["2022-11-18","2022-11-18"],[0,max(Burns)], 'r--')
xlabel('Day')
ylabel('Waiting time')

The only thing that I've changed from the .py file analyzing data from October-December to the one only analyzing November are adding in lines 1, 7, 9, 21, and 23, (I've written the numbers of these lines at the beginning of each respective line) along with the indentations that would be required for the loops associated with those lines.


问:
How can I add another store to Ebay API?
Now I want get OAuth token for my store on ebay.de, but I have only for store in ebay.com.
Help, please!

I figured out my developer api for my store on ebay.com.
When I try do this at https://developer.ebay.com/my/auth?env=production&index=0&auth_type=oauth by adding ebay redirect url to https://signin.ebay.de/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=true
It's havent success.

Should I create new accout for developer Ebay API for ebay.de or I can setting it in this account?


问:
How to quickly count number of occurs in df containg strings
I have downloaded data from: kaggle and i'm trying to count the number of film production for each actor. Column of cast looks like: cast_column

I'm making the splitted list of cast using (exception skips nans):

```<code>cast_list = []
for i in range(len(df['cast'])):
    try:
        cast_list.append(df['cast'][i].split(','))
    except AttributeError:
        pass
</code>```

Now i flatten that list and convert it to pd.df to use uniqe():

```<code>flat_cast_list = [num for sublist in cast_list for num in sublist]
pd_flat_cast_list = pd.DataFrame(flat_cast_list)
</code>```

And i'm using for loop to get names of actors and numbers of occurs in cast

```<code>names = []
numbers= []
for i in pd_flat_cast_list[0].unique():
        names.append(i)
        numbers.append(pd_flat_cast_list[0].str.contains(f'{i}').sum())
df1 = pd.DataFrame(list(zip(names, numbers)), columns = ['name', 'number'])
</code>```

I get what i wanted, but the problem is that loop it takes soo much time. I feel like there is a faster way to do that but i can't figure it out.

P.S i just noticed that after using of attribute function cast_list looks like:

```<code>['Sami Bouajila',
  ' Tracy Gotoas',
  ' Samuel Jouy',
  ' Nabiha Akkari',
  ' Sofia Lesaffre',
  ' Salim Kechiouche',
  ' Noureddine Farihi',
  ' Geert Van Rampelberg',
  ' Bakary Diombera'],
 ['Mayur More',
  ' Jitendra Kumar',
  ' Ranjan Raj',
  ' Alam Khan',
  ' Ahsaas Channa',
  ' Revathi Pillai',
  ' Urvi Singh',
  ' Arun Kumar'],
 ['Kate Siegel',
  ' Zach Gilford',
</code>```

So at the start we see that there is no space after ' but the next names contains space after ' . Thereby, loop won't count properly?

Body:
I have downloaded data from: kaggle and i'm trying to count the number of film production for each actor. Column of cast looks like: cast_column

I'm making the splitted list of cast using (exception skips nans):

cast_list = []
for i in range(len(df['cast'])):
    try:
        cast_list.append(df['cast'][i].split(','))
    except AttributeError:
        pass

Now i flatten that list and convert it to pd.df to use uniqe():

flat_cast_list = [num for sublist in cast_list for num in sublist]
pd_flat_cast_list = pd.DataFrame(flat_cast_list)

And i'm using for loop to get names of actors and numbers of occurs in cast

names = []
numbers= []
for i in pd_flat_cast_list[0].unique():
        names.append(i)
        numbers.append(pd_flat_cast_list[0].str.contains(f'{i}').sum())
df1 = pd.DataFrame(list(zip(names, numbers)), columns = ['name', 'number'])

I get what i wanted, but the problem is that loop it takes soo much time. I feel like there is a faster way to do that but i can't figure it out.

P.S i just noticed that after using of attribute function cast_list looks like:

['Sami Bouajila',
  ' Tracy Gotoas',
  ' Samuel Jouy',
  ' Nabiha Akkari',
  ' Sofia Lesaffre',
  ' Salim Kechiouche',
  ' Noureddine Farihi',
  ' Geert Van Rampelberg',
  ' Bakary Diombera'],
 ['Mayur More',
  ' Jitendra Kumar',
  ' Ranjan Raj',
  ' Alam Khan',
  ' Ahsaas Channa',
  ' Revathi Pillai',
  ' Urvi Singh',
  ' Arun Kumar'],
 ['Kate Siegel',
  ' Zach Gilford',

So at the start we see that there is no space after ' but the next names contains space after ' . Thereby, loop won't count properly?


问:
How to run a script on server from local machine?
I am trying to compress my folder, send it to the server, and decompress it. I set up the ssh-keygen so that scp and ssh works without password. However, once the ssh user@server line is executed, the remaining lines are not executed since the control is transferred to the server. Any ideas on how to accomplish this? I am not sure how to make this as a minimum-reproducible example.

```<code>tar -czvf targetfolder.tar.gz targetfolder
echo "zipped targetfolder; moving to server"
scp targetfolder.tar.gz user@server:
ssh user@server
cd ~/targetfolderonserver
rm -rf targetfolder
mv ~/targetfolder.tar.gz ./
tar -xf targetfolder.tar.gz
</code>```

Body:
I am trying to compress my folder, send it to the server, and decompress it. I set up the ssh-keygen so that scp and ssh works without password. However, once the ssh user@server line is executed, the remaining lines are not executed since the control is transferred to the server. Any ideas on how to accomplish this? I am not sure how to make this as a minimum-reproducible example.

tar -czvf targetfolder.tar.gz targetfolder
echo "zipped targetfolder; moving to server"
scp targetfolder.tar.gz user@server:
ssh user@server
cd ~/targetfolderonserver
rm -rf targetfolder
mv ~/targetfolder.tar.gz ./
tar -xf targetfolder.tar.gz


问:
How to use the element plus UI library with nuxt 3 setup?
I want to use the element plus UI library with the nuxt 3 setup. Need help on setup nuxt.config.ts file for element plus module

https://github.com/element-plus/element-plus-nuxt-starter/blob/main/nuxt.config.ts

I have tried the above things but it seems it is the old syntaxt or something wrong and not working.

```<code>[Vue warn]: Failed to resolve component: el-table-column
[Vue warn]: Failed to resolve component: el-table
[Vue warn]: Failed to resolve component: el-button

import { ElTable, ElTableColumn, ElButton } from "element-plus/dist/index.full.js";
</code>```

I have used the el plus table and table columns and button element but it returns this warning in the console. If I used to import (as mentioned above) each component then it works fine but I need to import the main el plus element globally.

I have installed the element plus as per the element installation guide for vue 3 and I am facing this issue in nuxt 3

Body:
I want to use the element plus UI library with the nuxt 3 setup. Need help on setup nuxt.config.ts file for element plus module

https://github.com/element-plus/element-plus-nuxt-starter/blob/main/nuxt.config.ts

I have tried the above things but it seems it is the old syntaxt or something wrong and not working.

[Vue warn]: Failed to resolve component: el-table-column
[Vue warn]: Failed to resolve component: el-table
[Vue warn]: Failed to resolve component: el-button

import { ElTable, ElTableColumn, ElButton } from "element-plus/dist/index.full.js";

I have used the el plus table and table columns and button element but it returns this warning in the console. If I used to import (as mentioned above) each component then it works fine but I need to import the main el plus element globally.

I have installed the element plus as per the element installation guide for vue 3 and I am facing this issue in nuxt 3


问:
Why does leaving the focus of an EditText inside a ListView clear the user input?
I have an activity with a ListView that gets filled by a custom adapter.
The adapter is filled via an ArrayList of Models with values from a JSON Object and Array.

What happens is that when you scan a barcode it fills the field with the value of the barcode but when you select the EditText of the second ListView layout it bugs back to the EditText you're trying to leave and due to the keyboard opening you can't see what happens but when you scroll up the ListView the previously filled in EditText is empty.

If you try to enter the value using the keyboard it 'works' but when you close the keyboard via the back button (Pixel 2 API V33) it also clears the previous input. But instead of having focus on the next EditText you gain focus on the ConstraintLayout of the first ListView item.

Filling adapter and calling the Adapter:

```<code>JSONArray resArr = objres.getJSONArray("Results");

for (int i = 0; i < resArr.length(); i++) {
    JSONObject temp = resArr.getJSONObject(i);
    ProductionLineModel productionLineModel = new ProductionLineModel(Barcode, temp.getString("..."), temp.getString("..."), temp.getString("..."), temp.getString("..."), temp.getString("..."));
    PalletIDModel palletIDModel = new PalletIDModel(temp.getString("..."), null, temp.getString("..."),  temp.getString("..."), temp.getString("..."), temp.getInt("..."));
    if (dataBaseHelper.AddProductionPallet(palletIDModel, Barcode)) {
        allLines.add(productionLineModel);
    } else {
        // Error handling
    }
}

ProductionListAdapter adapter = new ProductionListAdapter(this, R.layout.adapter_production_row, allLines, getIntent().getStringExtra("status"));

adapter.notifyDataSetChanged();

Lines_lv.setAdapter(adapter);
</code>```

Adapter getView method (NOTE: This has two types of adapters the issue happens in both):

```<code>@NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        String Itemcode = getItem(position).getItemcode();
        String ItemDesc = getItem(position).getItemdescription();
        String PalletQty = getItem(position).getPalletqty();
        if (Objects.equals(status, "GECLAIMED")) {
            //get the information
            String Location = getItem(position).getLocation();

            LayoutInflater inflater = LayoutInflater.from(mContext);
            convertView = inflater.inflate(mResource, parent, false);

            TextView tvitemcode = convertView.findViewById(R.id.textView37);
            TextView tvItemDesc = convertView.findViewById(R.id.textView38);
            TextView tvPalletQty = convertView.findViewById(R.id.textView39);
            EditText etvLocation = convertView.findViewById(R.id.PROD_location_etv);

            tvitemcode.setText(Itemcode);
            tvItemDesc.setText(ItemDesc);
            tvPalletQty.setText(PalletQty);
            etvLocation.setText(Location);

            EditText barcode = convertView.findViewById(R.id.PROD_barcode);
//            barcode.requestFocus();
            barcode.setOnEditorActionListener((v, actionId, event) -> {
                Log.e("Action", actionId + " + " + event);
                if (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER || actionId == EditorInfo.IME_ACTION_DONE) {
                    String newScan = barcode.getText().toString();
                    if (!newScan.isEmpty()) {
                        if (Objects.equals(getItem(position).getPalletcode(), newScan)) {
                            if (dataBaseHelper.UpdateProdPallet(getItem(position).getPalletcode(), getItem(position).getOrderNummer())) {
                                Toast.makeText(mContext, "Pallet geaccepteerd", Toast.LENGTH_SHORT).show();
                                barcode.setText(newScan);
                                Log.d("DEBUG", "Pallet accepted");
                                return true;
                            } else {
                                Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                                Log.e("DEBUG", "Pallet NOT accepted due: Database");
                                barcode.setText(newScan);
                            }
                        } else {
                            Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                            Log.e("DEBUG", "Pallet NOT accepted due: Codes not equal");
                            barcode.setText(newScan);
                        }
                    } else {
                        Toast.makeText(mContext, "Scan eerst een barcode", Toast.LENGTH_SHORT).show();
                        Log.e("DEBUG", "Pallet NOT accepted due: Nothing inserted");
                        barcode.setText(newScan);
                    }
                }
                return false;
            });
        } else {
            //get the information

            LayoutInflater inflater = LayoutInflater.from(mContext);
            convertView = inflater.inflate(mResource, parent, false);

            TextView tvitemcode = convertView.findViewById(R.id.textView37);
            TextView tvItemDesc = convertView.findViewById(R.id.textView38);
            TextView tvPalletQty = convertView.findViewById(R.id.textView39);
            EditText etvLocation = convertView.findViewById(R.id.PROD_location_etv);
            TextView textView = convertView.findViewById(R.id.textView40);
            convertView.findViewById(R.id.PROD_barcode).setVisibility(View.INVISIBLE);
            TextView tvProgress = convertView.findViewById(R.id.Progress_tv);

            tvitemcode.setText(Itemcode);
            tvItemDesc.setText(ItemDesc);
            tvPalletQty.setText(PalletQty);
            tvProgress.setVisibility(View.VISIBLE);

            tvProgress.setText("Scan uw pallet");
            textView.setText("Barcode");
            final boolean[] PalletUpdated = {false};

            etvLocation.setOnEditorActionListener((v, actionId, event) -> {
                if (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER || actionId == EditorInfo.IME_ACTION_DONE) {
                    String newScan = etvLocation.getText().toString();
                    if (!newScan.isEmpty()) {
                        if (Objects.equals(getItem(position).getPalletcode(), newScan)) {
                            if (!PalletUpdated[0]) {
                                if (dataBaseHelper.UpdateProdPallet(getItem(position).getPalletcode(), getItem(position).getOrderNummer())) {
                                    Toast.makeText(mContext, "Pallet geaccepteerd", Toast.LENGTH_SHORT).show();
                                    tvProgress.setText("Scan uw locatie");
                                    textView.setText("Locatie");
                                    etvLocation.setText(newScan);
                                    PalletUpdated[0] = true;
                                } else {
                                    Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                                    etvLocation.setText(newScan);
                                }
                            } else {
                                if (dataBaseHelper.UpdateProdPallet(getItem(position).getPalletcode(), getItem(position).getOrderNummer())) {
                                    Toast.makeText(mContext, "Locatie verstuurd", Toast.LENGTH_SHORT).show();
                                    tvProgress.setText("Scan uw pallet");
                                    textView.setText("Barcode");
                                    etvLocation.setText(newScan);
                                    PalletUpdated[0] = false;
                                } else {
                                    Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                                }
                            }
                        } else {
                            Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        Toast.makeText(mContext, "Scan eerst een barcode", Toast.LENGTH_SHORT).show();
                    }
                }
                return false;
            });
        }
        return convertView;
    }
</code>```

This issue happens on multiple devices for me. I tested it with a Pixel 2 Emulator running on API Level 33 and a Zebra scanner running on API Level 29

Body:
I have an activity with a ListView that gets filled by a custom adapter.
The adapter is filled via an ArrayList of Models with values from a JSON Object and Array.

What happens is that when you scan a barcode it fills the field with the value of the barcode but when you select the EditText of the second ListView layout it bugs back to the EditText you're trying to leave and due to the keyboard opening you can't see what happens but when you scroll up the ListView the previously filled in EditText is empty.

If you try to enter the value using the keyboard it 'works' but when you close the keyboard via the back button (Pixel 2 API V33) it also clears the previous input. But instead of having focus on the next EditText you gain focus on the ConstraintLayout of the first ListView item.

Filling adapter and calling the Adapter:

JSONArray resArr = objres.getJSONArray("Results");

for (int i = 0; i < resArr.length(); i++) {
    JSONObject temp = resArr.getJSONObject(i);
    ProductionLineModel productionLineModel = new ProductionLineModel(Barcode, temp.getString("..."), temp.getString("..."), temp.getString("..."), temp.getString("..."), temp.getString("..."));
    PalletIDModel palletIDModel = new PalletIDModel(temp.getString("..."), null, temp.getString("..."),  temp.getString("..."), temp.getString("..."), temp.getInt("..."));
    if (dataBaseHelper.AddProductionPallet(palletIDModel, Barcode)) {
        allLines.add(productionLineModel);
    } else {
        // Error handling
    }
}

ProductionListAdapter adapter = new ProductionListAdapter(this, R.layout.adapter_production_row, allLines, getIntent().getStringExtra("status"));

adapter.notifyDataSetChanged();

Lines_lv.setAdapter(adapter);

Adapter getView method (NOTE: This has two types of adapters the issue happens in both):

@NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        String Itemcode = getItem(position).getItemcode();
        String ItemDesc = getItem(position).getItemdescription();
        String PalletQty = getItem(position).getPalletqty();
        if (Objects.equals(status, "GECLAIMED")) {
            //get the information
            String Location = getItem(position).getLocation();

            LayoutInflater inflater = LayoutInflater.from(mContext);
            convertView = inflater.inflate(mResource, parent, false);

            TextView tvitemcode = convertView.findViewById(R.id.textView37);
            TextView tvItemDesc = convertView.findViewById(R.id.textView38);
            TextView tvPalletQty = convertView.findViewById(R.id.textView39);
            EditText etvLocation = convertView.findViewById(R.id.PROD_location_etv);

            tvitemcode.setText(Itemcode);
            tvItemDesc.setText(ItemDesc);
            tvPalletQty.setText(PalletQty);
            etvLocation.setText(Location);

            EditText barcode = convertView.findViewById(R.id.PROD_barcode);
//            barcode.requestFocus();
            barcode.setOnEditorActionListener((v, actionId, event) -> {
                Log.e("Action", actionId + " + " + event);
                if (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER || actionId == EditorInfo.IME_ACTION_DONE) {
                    String newScan = barcode.getText().toString();
                    if (!newScan.isEmpty()) {
                        if (Objects.equals(getItem(position).getPalletcode(), newScan)) {
                            if (dataBaseHelper.UpdateProdPallet(getItem(position).getPalletcode(), getItem(position).getOrderNummer())) {
                                Toast.makeText(mContext, "Pallet geaccepteerd", Toast.LENGTH_SHORT).show();
                                barcode.setText(newScan);
                                Log.d("DEBUG", "Pallet accepted");
                                return true;
                            } else {
                                Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                                Log.e("DEBUG", "Pallet NOT accepted due: Database");
                                barcode.setText(newScan);
                            }
                        } else {
                            Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                            Log.e("DEBUG", "Pallet NOT accepted due: Codes not equal");
                            barcode.setText(newScan);
                        }
                    } else {
                        Toast.makeText(mContext, "Scan eerst een barcode", Toast.LENGTH_SHORT).show();
                        Log.e("DEBUG", "Pallet NOT accepted due: Nothing inserted");
                        barcode.setText(newScan);
                    }
                }
                return false;
            });
        } else {
            //get the information

            LayoutInflater inflater = LayoutInflater.from(mContext);
            convertView = inflater.inflate(mResource, parent, false);

            TextView tvitemcode = convertView.findViewById(R.id.textView37);
            TextView tvItemDesc = convertView.findViewById(R.id.textView38);
            TextView tvPalletQty = convertView.findViewById(R.id.textView39);
            EditText etvLocation = convertView.findViewById(R.id.PROD_location_etv);
            TextView textView = convertView.findViewById(R.id.textView40);
            convertView.findViewById(R.id.PROD_barcode).setVisibility(View.INVISIBLE);
            TextView tvProgress = convertView.findViewById(R.id.Progress_tv);

            tvitemcode.setText(Itemcode);
            tvItemDesc.setText(ItemDesc);
            tvPalletQty.setText(PalletQty);
            tvProgress.setVisibility(View.VISIBLE);

            tvProgress.setText("Scan uw pallet");
            textView.setText("Barcode");
            final boolean[] PalletUpdated = {false};

            etvLocation.setOnEditorActionListener((v, actionId, event) -> {
                if (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER || actionId == EditorInfo.IME_ACTION_DONE) {
                    String newScan = etvLocation.getText().toString();
                    if (!newScan.isEmpty()) {
                        if (Objects.equals(getItem(position).getPalletcode(), newScan)) {
                            if (!PalletUpdated[0]) {
                                if (dataBaseHelper.UpdateProdPallet(getItem(position).getPalletcode(), getItem(position).getOrderNummer())) {
                                    Toast.makeText(mContext, "Pallet geaccepteerd", Toast.LENGTH_SHORT).show();
                                    tvProgress.setText("Scan uw locatie");
                                    textView.setText("Locatie");
                                    etvLocation.setText(newScan);
                                    PalletUpdated[0] = true;
                                } else {
                                    Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                                    etvLocation.setText(newScan);
                                }
                            } else {
                                if (dataBaseHelper.UpdateProdPallet(getItem(position).getPalletcode(), getItem(position).getOrderNummer())) {
                                    Toast.makeText(mContext, "Locatie verstuurd", Toast.LENGTH_SHORT).show();
                                    tvProgress.setText("Scan uw pallet");
                                    textView.setText("Barcode");
                                    etvLocation.setText(newScan);
                                    PalletUpdated[0] = false;
                                } else {
                                    Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                                }
                            }
                        } else {
                            Toast.makeText(mContext, "Pallet NIET geaccepteerd", Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        Toast.makeText(mContext, "Scan eerst een barcode", Toast.LENGTH_SHORT).show();
                    }
                }
                return false;
            });
        }
        return convertView;
    }

This issue happens on multiple devices for me. I tested it with a Pixel 2 Emulator running on API Level 33 and a Zebra scanner running on API Level 29


问:
is there a R function for datetime in Kaggle notebook? i can't change date format in R kaggle notebook
I can't change date format in R kaggle notebook. Is there a separate function for it in kaggle?

I tried installing 'tidyverse' and lubridate. Tidyverse installed but lubridate did not.
I tried changing date format of my data, it did not work.


问:
How to send the content of a textview on iOS16?
Before iOS16，I can use UIRemoteKeyboardWindow window to get the system keyboard and then access the send button to click it. But after the system was updated to iOS16, UIRemoteKeyboardWindow is deprecated. Is there any other way to get the keyboard window? Or is there a way to directly trigger the keyboard send event?

I tried to use the UITextEffectsWindow, but it can't access the elements of the keyboard.

I tried to access the UIInputSetHostView view in UITextEffectsWindow, which is the window where the keyboard is located. and I estimate the position of the send button, finally tap on this location with tapAtPoint, but it doesn't seem to work.

Here is my code

if(@available(iOS 16, *)){
    NSString *elementClass = NSStringFromClass(element.class);
    if([elementClass isEqualToString:@"UIInputSetHostView"] && [infoItem.requestLabelName isEqualToString:@"Send"]){
        CGSize sendPoint = tmpItem.view.frame.size;
        CGPoint originPoint = tmpItem.view.frame.origin;
        point.x = sendPoint.width * 0.85;
        point.y = sendPoint.height * 0.8;
    }
    [view tapAtPoint:point];
}
```


问:
Android force launcher Activity to be called after a crash/re-creation
I have an app with a working implementation where multiple managers are initialized in the launcher/splash screen Activity. Once all managers are successfully initialized, the main Activity is launched. The managers are being used later by multiple places and they hold static data.

The issue I'm facing on multiple Android versions is when the app crashes, the Android Framework re-creates and launches the Activity that crashed skipping the launcher/splash Activity (managers need to be initialized again before being accessed).

Is there a way to force going through or calling the launcher Activity again before going directly for recreating the Activity that crashed?