问:
Python Selenium webdriver.Chrome() sometimes returns "Timeout error from renderer: 600.00" exception
I'm using Selenium to run tests using Chrome Webdriver. Most of the time script works fine, but sometimes it returns a Timeout error when initializing webdriver.Chrome() constructor.

Below is the error message I'm receiving.

```<code>    Message: session not created
source-app-1  | from timeout: Timed out receiving message from renderer: 600.000
source-app-1  |   (Session info: headless chrome=102.0.5005.182)
</code>```

I see this failure at a rate of about 1 in 10 or sometimes about 1 in 20.

Below is the code when it sometimes hangs and returns the Timeout exception.

```<code>from selenium import webdriver

self.driver = webdriver.Chrome(executable_path=driver_executable_path,
                                 chrome_options=driver_options)
</code>```

ENVIRONMENT

The script runs inside the Docker container and below is my dockerfile.

```<code>FROM nginxinc/nginx-unprivileged:1-alpine
ENV PATH="/scripts:${PATH}"

USER root

# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3=3.9.15-r0 py3-setuptools  --repository=https://dl-cdn.alpinelinux.org/alpine/v3.15/main/
RUN ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install  --upgrade --no-cache pip

COPY ./requirements.txt /requirements.txt

RUN apk add --update --no-cache gcc libffi-dev libc-dev linux-headers openssl-dev cargo rust python3-dev libxml2-dev libxslt-dev jpeg-dev zlib-dev chromium chromium-chromedriver --repository=https://dl-cdn.alpinelinux.org/alpine/v3.15/main/
RUN pip3 install -r /requirements.txt

RUN mkdir -p /vol/static
RUN chmod 755 /vol/static

RUN mkdir /app
COPY . /app
WORKDIR /app

RUN adduser -D user
RUN chown -R user:user /vol
RUN chmod -R 755 /vol/web

CMD ["entrypoint.sh"]
</code>```

Docker Compose

```<code>version: '3.7'
services:
  app:
    build:
      context: .
    command: sh -c "python start.py"
    deploy:
      resources:
        limits:
          cpus: "2"
          memory: 2048M
        reservations:
          cpus: "0.25"
          memory: 128M
    volumes:
      - .:/app
    environment:
      ...

networks:
  default:
    external:
      name: my-network
</code>```

Body:
I'm using Selenium to run tests using Chrome Webdriver. Most of the time script works fine, but sometimes it returns a Timeout error when initializing webdriver.Chrome() constructor.

Below is the error message I'm receiving.

    Message: session not created
source-app-1  | from timeout: Timed out receiving message from renderer: 600.000
source-app-1  |   (Session info: headless chrome=102.0.5005.182)

I see this failure at a rate of about 1 in 10 or sometimes about 1 in 20.

Below is the code when it sometimes hangs and returns the Timeout exception.

from selenium import webdriver

self.driver = webdriver.Chrome(executable_path=driver_executable_path,
                                 chrome_options=driver_options)

ENVIRONMENT

The script runs inside the Docker container and below is my dockerfile.

FROM nginxinc/nginx-unprivileged:1-alpine
ENV PATH="/scripts:${PATH}"

USER root

# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3=3.9.15-r0 py3-setuptools  --repository=https://dl-cdn.alpinelinux.org/alpine/v3.15/main/
RUN ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install  --upgrade --no-cache pip

COPY ./requirements.txt /requirements.txt

RUN apk add --update --no-cache gcc libffi-dev libc-dev linux-headers openssl-dev cargo rust python3-dev libxml2-dev libxslt-dev jpeg-dev zlib-dev chromium chromium-chromedriver --repository=https://dl-cdn.alpinelinux.org/alpine/v3.15/main/
RUN pip3 install -r /requirements.txt

RUN mkdir -p /vol/static
RUN chmod 755 /vol/static

RUN mkdir /app
COPY . /app
WORKDIR /app

RUN adduser -D user
RUN chown -R user:user /vol
RUN chmod -R 755 /vol/web

CMD ["entrypoint.sh"]

Docker Compose

version: '3.7'
services:
  app:
    build:
      context: .
    command: sh -c "python start.py"
    deploy:
      resources:
        limits:
          cpus: "2"
          memory: 2048M
        reservations:
          cpus: "0.25"
          memory: 128M
    volumes:
      - .:/app
    environment:
      ...

networks:
  default:
    external:
      name: my-network


来源: stackexchange

问:
Is it necessary add IsAuthenticated permissions to permission_classes in view that is inherited from LoginRequiredMixin
I have a class-based view called ProfileDetail. It is inherit LoginRequiredMixin from django.contrib.auth.mixins. And then set permission_classes = (IsAuthenticated,). Basically all client that view ProfileDetail is already logged-in, hence authenticated. My question is, is it necessary to set permission_classes = (IsAuthenticated,) even though all client already logged-in? What's your advice? Thank you.

views.py

```<code>from django.contrib.auth.mixins import LoginRequiredMixin

from rest_framework import generics
from rest_framework.permissions import IsAuthenticated

from .models import Profile
from .serializers import ProfileSerializer

class ProfileDetail(LoginRequiredMixin, generics.RetrieveUpdateAPIView):
    permission_classes = (IsAuthenticated,)
    serializer_class = ProfileSerializer
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a class-based view called ProfileDetail. It is inherit LoginRequiredMixin from django.contrib.auth.mixins. And then set permission_classes = (IsAuthenticated,). Basically all client that view ProfileDetail is already logged-in, hence authenticated. My question is, is it necessary to set permission_classes = (IsAuthenticated,) even though all client already logged-in? What's your advice? Thank you.

views.py

from django.contrib.auth.mixins import LoginRequiredMixin

from rest_framework import generics
from rest_framework.permissions import IsAuthenticated

from .models import Profile
from .serializers import ProfileSerializer

class ProfileDetail(LoginRequiredMixin, generics.RetrieveUpdateAPIView):
    permission_classes = (IsAuthenticated,)
    serializer_class = ProfileSerializer


问:
IPython/Spyder - how to list workspace variables with wildcard characters like MATLAB
I would like to list the workspace variables like MATLAB. For example, in MATLAB I can use "whos con*" to list all variables which start with "con". When I try the same thing in spyder, I get the following error - any workarounds?</p>
```<code>whos con*
No variables match your requested type.
</code>```

Body:
I would like to list the workspace variables like MATLAB. For example, in MATLAB I can use "whos con*" to list all variables which start with "con". When I try the same thing in spyder, I get the following error - any workarounds?

whos con*
No variables match your requested type.


问:
How to fetch load my commands folder and its sub-directories?
I'm writing a bot using NodeJS, and I'm pretty stuck. I'm attempting on creating a help command for the bot, and my folders look something like this: commands/slash and after the /slash I have my commands categorised, so like Moderation commands are in the Moderation folder, and so on..

so this is my current code:

```<code>import Command from "../../../structures/Command.js"
import { Embed } from "eris-addons"
import fs from "fs"
import { readdirSync } from "fs"
import path from "path"
import { join } from "path"

import { fileURLToPath } from "url"

const __dirname = path.dirname(fileURLToPath(import.meta.url));

// Map of category names to command objects
const categories = new Map();

// Load commands from the "commands/slash" folder and its subdirectories
const commandFolders = readdirSync(path.join(__dirname, '../'));
for (const folder of commandFolders) {
    const fullPath = path.join(__dirname, '../', folder);
    if (fs.lstatSync(fullPath).isDirectory()) {
        const commandFiles = fs.readdirSync(fullPath).filter((file) => file.endsWith('.js'));
        for (const file of commandFiles) {
            const filePath = path.join(fullPath, file);
            const { default: CommandClass } = await import(filePath);
            const command = new CommandClass();
            if (!categories.has(folder)) {
                categories.set(folder, []);
            }
            categories.get(folder).push(command);
        }
    }
}
</code>```

and my error is Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

coming from const { default: CommandClass } = await import(filePath);

how can i fix this?

Body:
I'm writing a bot using NodeJS, and I'm pretty stuck. I'm attempting on creating a help command for the bot, and my folders look something like this: commands/slash and after the /slash I have my commands categorised, so like Moderation commands are in the Moderation folder, and so on..

so this is my current code:

import Command from "../../../structures/Command.js"
import { Embed } from "eris-addons"
import fs from "fs"
import { readdirSync } from "fs"
import path from "path"
import { join } from "path"

import { fileURLToPath } from "url"

const __dirname = path.dirname(fileURLToPath(import.meta.url));

// Map of category names to command objects
const categories = new Map();

// Load commands from the "commands/slash" folder and its subdirectories
const commandFolders = readdirSync(path.join(__dirname, '../'));
for (const folder of commandFolders) {
    const fullPath = path.join(__dirname, '../', folder);
    if (fs.lstatSync(fullPath).isDirectory()) {
        const commandFiles = fs.readdirSync(fullPath).filter((file) => file.endsWith('.js'));
        for (const file of commandFiles) {
            const filePath = path.join(fullPath, file);
            const { default: CommandClass } = await import(filePath);
            const command = new CommandClass();
            if (!categories.has(folder)) {
                categories.set(folder, []);
            }
            categories.get(folder).push(command);
        }
    }
}

and my error is Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

coming from const { default: CommandClass } = await import(filePath);

how can i fix this?


问:
Columns are not populating numbers
I have some data from weeks that I am trying to populate into the graph, the columns that should be displaying the data for 5 weeks and then the total.  Please see the picture.  Instead they all come up empty.

enter image description here

I know it is a case statement to here is what I have.

```<code>SET DATEFIRST 1;

DECLARE @mEnd DATETIME;
DECLARE @InputDate DATETIME;
DECLARE @EndOfMonthTemp DATETIME;

SET @EndOfMonth = @mEnd;
SET @StartWeek1 = @InputDate;
SET @StartWeek2 = DATEADD(day, 8-(DATEPART(weekday, @StartWeek1)), @StartWeek1);

SET @StartWeek3 = CASE WHEN DATEADD(day, 7, @StartWeek2) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek2) END;

SET @StartWeek4 = CASE WHEN DATEADD(day, 7, @StartWeek3) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek3) END;

SET @StartWeek5 = CASE WHEN DATEADD(day, 7, @StartWeek4) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek4) END;

SET @StartWeek6 = CASE WHEN DATEADD(day, 7, @StartWeek5) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek5) END;

SET @InputDate = DATEFROMPARTS(YEAR(@InputDate), MONTH(@InputDate), 1)
SET @mEnd = EOMONTH(@InputDate)

DECLARE @StartWeek1 DATETIME
DECLARE @StartWeek2 DATETIME
DECLARE @StartWeek3 DATETIME
DECLARE @StartWeek4 DATETIME
DECLARE @StartWeek5 DATETIME
DECLARE @StartWeek6 DATETIME
DECLARE @EndOfMonth DATETIME

SET @EndOfMonthTemp = DATEADD(day, 1, EOMONTH(@InputDate)) -- add a day
SET @EndOfMonth = DATEADD(second, -1, @mEnd); -- subtract a second
</code>```

Select

filled
, SentDate_1
, Program

```<code> , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek1 AND DATEADD(second, -1, @StartWeek2) THEN 1 ELSE NULL END) AS [Week1]

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek2 AND DATEADD(second, -1, @StartWeek3) THEN 1

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek3 AND DATEADD(second, -1, @StartWeek4) THEN 1 ELSE NULL END) AS [Week3]

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek4 AND DATEADD(second, -1, @StartWeek5) THEN 1

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek5 AND DATEADD(second, -1, @EndOfMonth) THEN 1 ELSE NULL END) AS [Week5]
</code>```
```<code>
     , COUNT(*) AS [Total]

     from
     VADER

     INNER JOIN  WALKER E1 ON (E5.GUID = E1.GUID)
     WHERE
     SentDate_1 >= DATEADD(MONTH,DATEDIFF(MONTH,0,GETDATE()),0) and Program = 'My results'

       GROUP BY   filled
                 ,SentDate_1
                 ,Program

Should look like this.

[enter image description here](https://i.stack.imgur.com/BLT38.png)

Thank you in advance!!!!
</code>```

Title: Columns are not populating numbers

Body:
I have some data from weeks that I am trying to populate into the graph, the columns that should be displaying the data for 5 weeks and then the total.  Please see the picture.  Instead they all come up empty.

enter image description here

I know it is a case statement to here is what I have.

SET DATEFIRST 1;

DECLARE @mEnd DATETIME;
DECLARE @InputDate DATETIME;
DECLARE @EndOfMonthTemp DATETIME;

SET @EndOfMonth = @mEnd;
SET @StartWeek1 = @InputDate;
SET @StartWeek2 = DATEADD(day, 8-(DATEPART(weekday, @StartWeek1)), @StartWeek1);

SET @StartWeek3 = CASE WHEN DATEADD(day, 7, @StartWeek2) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek2) END;

SET @StartWeek4 = CASE WHEN DATEADD(day, 7, @StartWeek3) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek3) END;

SET @StartWeek5 = CASE WHEN DATEADD(day, 7, @StartWeek4) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek4) END;

SET @StartWeek6 = CASE WHEN DATEADD(day, 7, @StartWeek5) > @EndOfMonth THEN @EndOfMonth ELSE DATEADD(day, 7, @StartWeek5) END;

SET @InputDate = DATEFROMPARTS(YEAR(@InputDate), MONTH(@InputDate), 1)
SET @mEnd = EOMONTH(@InputDate)

DECLARE @StartWeek1 DATETIME
DECLARE @StartWeek2 DATETIME
DECLARE @StartWeek3 DATETIME
DECLARE @StartWeek4 DATETIME
DECLARE @StartWeek5 DATETIME
DECLARE @StartWeek6 DATETIME
DECLARE @EndOfMonth DATETIME

SET @EndOfMonthTemp = DATEADD(day, 1, EOMONTH(@InputDate)) -- add a day
SET @EndOfMonth = DATEADD(second, -1, @mEnd); -- subtract a second

Select

filled
, SentDate_1
, Program

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek1 AND DATEADD(second, -1, @StartWeek2) THEN 1 ELSE NULL END) AS [Week1]

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek2 AND DATEADD(second, -1, @StartWeek3) THEN 1

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek3 AND DATEADD(second, -1, @StartWeek4) THEN 1 ELSE NULL END) AS [Week3]

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek4 AND DATEADD(second, -1, @StartWeek5) THEN 1

 , COUNT(CASE WHEN EDISCLOSEDTRK_SentDate_1 BETWEEN @StartWeek5 AND DATEADD(second, -1, @EndOfMonth) THEN 1 ELSE NULL END) AS [Week5]

     , COUNT(*) AS [Total]

     from
     VADER

     INNER JOIN  WALKER E1 ON (E5.GUID = E1.GUID)
     WHERE
     SentDate_1 >= DATEADD(MONTH,DATEDIFF(MONTH,0,GETDATE()),0) and Program = 'My results'

       GROUP BY   filled
                 ,SentDate_1
                 ,Program

Should look like this.

[enter image description here](https://i.stack.imgur.com/BLT38.png)

Thank you in advance!!!!


问:
Using HTML entity codes with Javascript methods like inludes() and charAt()
I am trying to build a tool to help me memorize the guitar fretboard and I want to include a feature that lets me switch between sharp notes and flat notes. I'm almost there but some of Javascript's methods don't seem to recognise HTML entity codes. The first function works fine when I assign the ball.innerHTML to flat notes. The problem occurs when I try to switch back to sharps using the sharpFunc().

```<code>function nextChar(char) {
    return String.fromCharCode(char.charCodeAt(0) + 1);
}

flatNote.addEventListener('click', flatFunc);
function flatFunc() {
    ballArray.forEach(function(ball) {
        ball.innerHTML.includes('#') ?
        ball.innerHTML = nextChar(ball.innerHTML).concat('♭') : ball.innerHTML;
        ball.innerHTML.includes('H') ? ball.innerHTML = `A♭` : ball;
    })
}

// function prevChar(char) {
//     return String.fromCharCode(char.charCodeAt(0) - 1);
// }

sharpNote.addEventListener('click', sharpFunc);
function sharpFunc() {
    ballArray.forEach(function(ball) {
        ball.innerHTML.includes('U+0266D;') ?
        ball.innerHTML = 'oh' : ball.innerHTML;
    })
}
</code>```

I have tried using different types of code to represent the flat note and I have tried numerous types of conditionals. Nothing is working.

Body:
I am trying to build a tool to help me memorize the guitar fretboard and I want to include a feature that lets me switch between sharp notes and flat notes. I'm almost there but some of Javascript's methods don't seem to recognise HTML entity codes. The first function works fine when I assign the ball.innerHTML to flat notes. The problem occurs when I try to switch back to sharps using the sharpFunc().

function nextChar(char) {
    return String.fromCharCode(char.charCodeAt(0) + 1);
}

flatNote.addEventListener('click', flatFunc);
function flatFunc() {
    ballArray.forEach(function(ball) {
        ball.innerHTML.includes('#') ?
        ball.innerHTML = nextChar(ball.innerHTML).concat('♭') : ball.innerHTML;
        ball.innerHTML.includes('H') ? ball.innerHTML = `A♭` : ball;
    })
}

// function prevChar(char) {
//     return String.fromCharCode(char.charCodeAt(0) - 1);
// }

sharpNote.addEventListener('click', sharpFunc);
function sharpFunc() {
    ballArray.forEach(function(ball) {
        ball.innerHTML.includes('U+0266D;') ?
        ball.innerHTML = 'oh' : ball.innerHTML;
    })
}

I have tried using different types of code to represent the flat note and I have tried numerous types of conditionals. Nothing is working.


问:
Open MPI oversubscription failling
I'm trying to run a MPI C program with more process than CPUs I have using the --oversubscribe flag. The problem is that even if I do that it returns  segmentation fault.

$ mpirun -np 8 --oversubscribe ./a

```<code>[0piero:68195] *** Process received signal ***
[0piero:68195] Signal: Segmentation fault (11)
[0piero:68195] Signal code: Address not mapped (1)
[0piero:68195] Failing at address: 0x7fd162194c80
[0piero:68185] *** Process received signal ***
[0piero:68185] Signal: Segmentation fault (11)
[0piero:68185] Signal code: Address not mapped (1)
[0piero:68185] Failing at address: 0x7ffbf42f13e0
[0piero:68185] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7ffbf88e2520]
[0piero:68185] [ 1] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc2b0)[0x7ffbf48d42b0]
[0piero:68185] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x94b43)[0x7ffbf8934b43]
[0piero:68185] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x126a00)[0x7ffbf89c6a00]
[0piero:68185] *** End of error message ***
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
</code>```

mpirun noticed that process rank 5 with PID 0 on node 0piero exited on signal 11 (Segmentation fault).

I'm currently using the Open MPI 4.1.2.

Title: Open MPI oversubscription failling

Body:
I'm trying to run a MPI C program with more process than CPUs I have using the --oversubscribe flag. The problem is that even if I do that it returns  segmentation fault.

$ mpirun -np 8 --oversubscribe ./a

[0piero:68195] *** Process received signal ***
[0piero:68195] Signal: Segmentation fault (11)
[0piero:68195] Signal code: Address not mapped (1)
[0piero:68195] Failing at address: 0x7fd162194c80
[0piero:68185] *** Process received signal ***
[0piero:68185] Signal: Segmentation fault (11)
[0piero:68185] Signal code: Address not mapped (1)
[0piero:68185] Failing at address: 0x7ffbf42f13e0
[0piero:68185] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7ffbf88e2520]
[0piero:68185] [ 1] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc2b0)[0x7ffbf48d42b0]
[0piero:68185] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x94b43)[0x7ffbf8934b43]
[0piero:68185] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x126a00)[0x7ffbf89c6a00]
[0piero:68185] *** End of error message ***
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------

mpirun noticed that process rank 5 with PID 0 on node 0piero exited on signal 11 (Segmentation fault).

I'm currently using the Open MPI 4.1.2.


问:
How to handle b+ trees when the leaf nodes store content with variable size?
Some databases (like MySQL) use B+trees as a way to physically organize records. The primary index (also called clustering index) stores the keys as internal nodes and the records in the leaf level.

Since all pages have fixed size, I suppose that internal nodes and leaf nodes have different degrees: The degree of internal nodes is derived from the primary key size, and the degree of the leaf nodes is derived from the record size.

What if the record size is variable? How the degree of the leaf level is set?

Additionally, I always study b+trees under the assumption that keys have the same size. It enables a straightforward method for splitting and dividing the nodes. What about the leaf level? How to balance the nodes when the records to move have variable sizes?


问:
Angular Material Virtual Scroller gets stuck sometimes on Mobile only unsure why
HTML

```<code><section fxLayout="column" fxLayoutAlign="center center" class="vwubble-section" fxFlex="auto">
        <ng-container *ngIf="(allBubbles$ | async)">

                <cdk-virtual-scroll-viewport #scroller itemSize="355" class="scrolling-container scrollbar-hidden" minBufferPx="1200" maxBufferPx="1200">
                    <vw-vwubbles-item *cdkVirtualFor="let bubble of allBubbles$"
                                      [bubble]="bubble">
                    </vw-vwubbles-item>
                </cdk-virtual-scroll-viewport>

        </ng-container>
</section>
</code>```

CSS

```<code>.vwubble-section {
    padding: 0px;
    margin: 0px;
    padding-top: 20px;
    min-width: 100%;
    /* padding-top: 300px; */
    background-color: #000;
    /* margin-bottom: 60px; */
    /* height:  1400px;
    overflow:hidden; */
}

.mat-form-field-appearance-fill .mat-form-field-flex{
    background-color: white;
}

::ng-deep .mat-select-value {
    color: #673ab7;
}

.scrolling-container{
    /* display: flex; */
    min-height: 1600px;
    /* flex-grow: 1; */
    width: 100%;
    max-width:800px;
    overflow-y: scroll;
    padding: 0px;
    overflow-x: hidden;
}
.scrolling-container::-webkit-scrollbar {
    width: 0;  /* Remove scrollbar space */
    background: transparent;  /* Optional: just make scrollbar invisible */
}
</code>```

So these vwubble-items are like tweets, and the scroll gets stuck when the user tries to scroll down on mobile, but the weird thing is that I am using this same scrolling method for the replies to these main threads, and these replies never get stuck ever.

Any help would be much appreciated.

Body:
HTML

        <ng-container *ngIf="(allBubbles$ | async)">

                <cdk-virtual-scroll-viewport #scroller itemSize="355" class="scrolling-container scrollbar-hidden" minBufferPx="1200" maxBufferPx="1200">
                    <vw-vwubbles-item *cdkVirtualFor="let bubble of allBubbles$"
                                      [bubble]="bubble">
                    </vw-vwubbles-item>
                </cdk-virtual-scroll-viewport>

        </ng-container>

CSS

.vwubble-section {
    padding: 0px;
    margin: 0px;
    padding-top: 20px;
    min-width: 100%;
    /* padding-top: 300px; */
    background-color: #000;
    /* margin-bottom: 60px; */
    /* height:  1400px;
    overflow:hidden; */
}

.mat-form-field-appearance-fill .mat-form-field-flex{
    background-color: white;
}

::ng-deep .mat-select-value {
    color: #673ab7;
}

.scrolling-container{
    /* display: flex; */
    min-height: 1600px;
    /* flex-grow: 1; */
    width: 100%;
    max-width:800px;
    overflow-y: scroll;
    padding: 0px;
    overflow-x: hidden;
}
.scrolling-container::-webkit-scrollbar {
    width: 0;  /* Remove scrollbar space */
    background: transparent;  /* Optional: just make scrollbar invisible */
}

So these vwubble-items are like tweets, and the scroll gets stuck when the user tries to scroll down on mobile, but the weird thing is that I am using this same scrolling method for the replies to these main threads, and these replies never get stuck ever.

Any help would be much appreciated.


问:
Using slice in c# how to
I am looking for this result in c#

```<code>string img = “123-beut.jpg” ;
string img2 = 01236-beu.jpg ;
</code>```

I want to slice the string before (-)
Result :
Img = 123
Img2 = 01236

Title: Using slice in c# how to

Body:
I am looking for this result in c#

string img = “123-beut.jpg” ;
string img2 = 01236-beu.jpg ;

I want to slice the string before (-)
Result :
Img = 123
Img2 = 01236


问:
How to share data between Http server Message handler and Http client message Handler using In - memory Cache
I am working with dotnet 6 web api .  I am trying to implement the Http Message handlers both from server side and client side . I wanted a way to share the data between the two Message Handlers using some Local storage .

I know that adding data to header will also do the trick . But i have multiple Http Clients , so i need to figure out a way to share data among them also , without touching the controller code . I am reading about cache mechanism but didnt find any such example.

Any help or direction will be appreciated.


问:
How to stop youtube video onclick in Reactjs
I am working on Reactjs and using Nextjs,Right now i am displaying "Youtube video" in slider,But i want
whenever we click on "arrow/next/previous" button then that vidoe should stop/pause,How can i do this ? Here is my current code</p>
```<code>return (
    <>
        <div className={`carousel-item ${index === 0 ? 'active' : ''}`}>
            <YouTube videoId={post.VideoId}
                                opts={opts} />
        </div>
    </>
     )
 <button className="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">
    <span className="carousel-control-prev-icon"></span>
  </button>
  <button className="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">
    <span className="carousel-control-next-icon"></span>
  </button>
</code>```

Body:
I am working on Reactjs and using Nextjs,Right now i am displaying "Youtube video" in slider,But i want
whenever we click on "arrow/next/previous" button then that vidoe should stop/pause,How can i do this ? Here is my current code

return (
    <>
        <div className={`carousel-item ${index === 0 ? 'active' : ''}`}>
            <YouTube videoId={post.VideoId}
                                opts={opts} />

    </>
     )
 <button className="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">

  </button>
  <button className="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">

  </button>


问:
I tried to deploy my project(Web application) on AWS Amplify But ERR! ERR! Missing script: "build" At Fronted

My project is react.js

I tried to fix follow this blog But it's not work again still build failed to complete successfully.

And this is scripts in my package.json file in my fronted directory.


问:
How to get ids of TestRail's Runs from Jira task?
I see request in jira like: "index.php?/ext/jira...issue={task id}...".

I need to get ids of runs, then parse runs from TestRail API.

Maybe there is an easier way to get that ids?


问:
Flower UI not showing processes from all running Celery pods
My config has 1 celery worker, 1 queue and I have 5 pods running celery, each with concurrency of 8. I can see the incoming tasks being spread to all 5 pods.But Flower UI shows 1 queue having max concurrency 8 and number of processes 8.
My question is - I should be able to see 40 processes (8 concurrency * 5 pods) on Flower UI for the celery queue.
Is my understanding incorrect or some config missing from Flower?

My start celery script has - celery -A <task-filename> worker -Ofair --loglevel INFO -Q ocr-queue1 &
The tasks and pods don't have any issue. The pod machine has 8 cores, making the default concurrency to 8, the number of processes the worker can spawn.
However I have 5 such pods running, but Flower shows.


问:
Neovim config error: '<eof>' expected near 'local'
I'm setting up Neovim like this guy in this video: https://www.youtube.com/watch?v=vdn_pKJUda8&t=145s&ab_channel=JoseanMartinez

I'm using WSL - Windows subsystem for Linux.

And I have this error in ~/.config/nvim/lua/suleiman/plugins-setup.lua file:

```<code>Error detected while processing /home/suleiman/.config/nvim/init.lua:
E5113: Error while calling lua chunk: vim/_init_packages.lua:0:
/home/suleiman/.config/nvim/lua/suleiman/plugins-setup.lua:24: '<eof>' expected near 'local'
stack traceback:
        [C]: in function 'error'
        vim/_init_packages.lua: in function <vim/_init_packages.lua:0>
        [C]: in function 'require'
        /home/suleiman/.config/nvim/init.lua:1: in main chunk
</code>```

And here is the file itself:

```<code>vim.cmd([[
  augroup packer_user_config
    autocmd!
    autocmd BufWritePost plugins.lua source <afile> | PackerCompile
  augroup end
]])

local status, packer = pcall(require, 'packer')
if not status then
  return
end

return packer.startup(function(use)
  use('wbthomason/packer.nvim')

  use('bluz71/vim-nightfly-guicolors')

  if packer_bootstrap then
    require('packer').sync()
  end
end)

local ensure_packer = function()   // This is the line:24
  local fn = vim.fn
  local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
  if fn.empty(fn.glob(install_path)) > 0 then
    fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
    vim.cmd [[packadd packer.nvim]]
    return true
  end
  return false
end

local packer_bootstrap = ensure_packer()

return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim'
  -- My plugins here
  -- use 'foo1/bar1.nvim'
  -- use 'foo2/bar2.nvim'

  -- Automatically set up your configuration after cloning packer.nvim
  -- Put this at the end after all plugins
  if packer_bootstrap then
    require('packer').sync()
  end
end)
</code>```

plugins-setup.lua

And this is here is the ~/.config/nvim/init.lua file where I require that file:

```<code>require('suleiman.plugins-setup')
require('suleiman.core.options')
require('suleiman.core.keymaps')
require('suleiman.core.colorscheme')
</code>```

I searched on this error, I didn't find the solution.

There isn't supposed to be an error at all I think, because I copied what that guy on that video did.

Body:
I'm setting up Neovim like this guy in this video: https://www.youtube.com/watch?v=vdn_pKJUda8&t=145s&ab_channel=JoseanMartinez

I'm using WSL - Windows subsystem for Linux.

And I have this error in ~/.config/nvim/lua/suleiman/plugins-setup.lua file:

Error detected while processing /home/suleiman/.config/nvim/init.lua:
E5113: Error while calling lua chunk: vim/_init_packages.lua:0:
/home/suleiman/.config/nvim/lua/suleiman/plugins-setup.lua:24: '<eof>' expected near 'local'
stack traceback:
        [C]: in function 'error'
        vim/_init_packages.lua: in function <vim/_init_packages.lua:0>
        [C]: in function 'require'
        /home/suleiman/.config/nvim/init.lua:1: in main chunk

And here is the file itself:

vim.cmd([[
  augroup packer_user_config
    autocmd!
    autocmd BufWritePost plugins.lua source <afile> | PackerCompile
  augroup end
]])

local status, packer = pcall(require, 'packer')
if not status then
  return
end

return packer.startup(function(use)
  use('wbthomason/packer.nvim')

  use('bluz71/vim-nightfly-guicolors')

  if packer_bootstrap then
    require('packer').sync()
  end
end)

local ensure_packer = function()   // This is the line:24
  local fn = vim.fn
  local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
  if fn.empty(fn.glob(install_path)) > 0 then
    fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
    vim.cmd [[packadd packer.nvim]]
    return true
  end
  return false
end

local packer_bootstrap = ensure_packer()

return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim'
  -- My plugins here
  -- use 'foo1/bar1.nvim'
  -- use 'foo2/bar2.nvim'

  -- Automatically set up your configuration after cloning packer.nvim
  -- Put this at the end after all plugins
  if packer_bootstrap then
    require('packer').sync()
  end
end)

plugins-setup.lua

And this is here is the ~/.config/nvim/init.lua file where I require that file:

require('suleiman.plugins-setup')
require('suleiman.core.options')
require('suleiman.core.keymaps')
require('suleiman.core.colorscheme')

I searched on this error, I didn't find the solution.

There isn't supposed to be an error at all I think, because I copied what that guy on that video did.


问:
The website when accessed from google displays malicious content
My website currently accessed from google has malicious content, with any links. I've tried and found that any request with a header with a Referrer with the value "google" is showing malicious content, the entire page content is changed. I don't know what is the problem I have, does anyone know about it?</p>


问:
API Gateway End Points to Microservices
We are building a cloud native architecture with React Frontend on S3, API Gateway, Microservices on Lamba functions and necessary AWS services. API Gateway to fulfill the cross-cutting concerns and to act as a BFF.

My question is about the mapping between the API Gateway and Microservices. There are 3 microservices (let say order, customer, payment) built on Java Spring.

Should I need to create equivalent API's (https proxy) in API gateway to connect to the microservices?

If so, should I need to create 3 API resources with 2 endpoint methods (let say get, post) in API gateway to map all the 3 microservices? so 3 API's with 6 methods in total?

If so, should I need to create a microservice per API method (let say get, post) so 6 microservices in total?

When comes to microservice that's also a Rest service which means list of Resources and methods again. In that case, 3 Microservices with (3 Resources X each 2 Methods) - 6 methods in total?

So, I could visualize one to many mapping between API methods in API gateway and Microservice methods like 6 X 6 combinations? I agree microservice should not be actions based but creating a few CRUD actions is planned for now.

For cross-cutting concerns (auth, logging etc.), should we define separate API resources in API Gateway? then no microservices required in that case.

I read a lot about API Gateway and Microservices but I could not get a clear understanding on the best practices around creating the API end points when it comes to integration with microservices. Please shed some light. Thanks.

Title: API Gateway End Points to Microservices


问:
How to save dotx as docx in phpword that readable in microsoft word
I am using phpword TemplateProcessor to open dotx. Then, do variable replacement. At last, I want to save as docx. Once I saved as docx, the file could not be opened in microsoft word.

office open XML output.docx could not be opened in microsoft word 2007 because there are problem with contents.

```<code>require_once 'vendor/autoload.php';
use PhpOffice\PhpWord\TemplateProcessor;
use PhpOffice\PhpWord\IOFactory;
$templateProcessor = new TemplateProcessor('template.dotx');
$templateProcessor->setValue('var1', 'val1');
$templateProcessor->saveAs('output.docx');
//$templateProcessor->saveAs('output.dotx');
//$templateProcessor->saveAs('output.doc');
</code>```

When I save as dotx, the file can be opened in microsoft word 2007.

When I search for this error, this link explain:

This problem occurs if the following conditions are true:

The mail merge document was saved in the .docx file format.

Note This problem does not occur if you open a mail merge document that was saved in the .doc file format.

The mail merge document uses a separate header source.

This problem occurs because Word 2007 does not support the .docx file
format for a mail merge document that uses a separate header file.

Then, I have saveAs('output.doc'). That file can be opened in microsoft word 2007 without any error.

But, my requirement is to save as docx.
Thank you

Body:
I am using phpword TemplateProcessor to open dotx. Then, do variable replacement. At last, I want to save as docx. Once I saved as docx, the file could not be opened in microsoft word.

office open XML output.docx could not be opened in microsoft word 2007 because there are problem with contents.

require_once 'vendor/autoload.php';
use PhpOffice\PhpWord\TemplateProcessor;
use PhpOffice\PhpWord\IOFactory;
$templateProcessor = new TemplateProcessor('template.dotx');
$templateProcessor->setValue('var1', 'val1');
$templateProcessor->saveAs('output.docx');
//$templateProcessor->saveAs('output.dotx');
//$templateProcessor->saveAs('output.doc');

When I save as dotx, the file can be opened in microsoft word 2007.

When I search for this error, this link explain:

This problem occurs if the following conditions are true:

The mail merge document was saved in the .docx file format.

Note This problem does not occur if you open a mail merge document that was saved in the .doc file format.

The mail merge document uses a separate header source.

This problem occurs because Word 2007 does not support the .docx file
format for a mail merge document that uses a separate header file.

Then, I have saveAs('output.doc'). That file can be opened in microsoft word 2007 without any error.

But, my requirement is to save as docx.
Thank you


问:
Can I mute the other party's voice with livekit?
I develop meeting applications with React and livekit.

I want to mute the voices of other users in the room, is there a good way to do this?


问:
what is the difference between KEDA MessageCount and queueLength while using Azure Service Bus triggers
I am using KEDA to scale my k8s deployments based on the number of active messages on an Azure Service Bus topic.
I am confused between the usage of MessageCount and queueLength properties in a scaledObject definition.
Can someone guide me on which one is used for what?

really appreciate the help!


问:
What is the TestStand run time error -17501?
I got below teststand run time error.

When would this error occured?

How to tackle this error?

Can anyone give me an answer?


问:
flutter web, display image from pdfFile assets
hey guys I need to convert image from pdf file!

i have an experience image to pdf but

```<code>Future<void> addPage(pw.Document pdf, String filename) async {
final imageByteData = await rootBundle.load('assets/$filename');
// Convert ByteData to Uint8List
final imageUint8List = imageByteData.buffer.asUint8List(imageByteData.offsetInBytes, imageByteData.lengthInBytes);

final image = pw.MemoryImage(imageUint8List);
pdf.addPage(
  pw.Page(
    build: (pw.Context context) {
      return pw.Center(
        child: pw.Image(image),
      ); // Center
    },
  ),
);
</code>```

}

i have tried this kind of solution didn't work as I want

so for examople if i have 3 files in pdf file I need to change each files to image and display it

Body:
hey guys I need to convert image from pdf file!

i have an experience image to pdf but

Future<void> addPage(pw.Document pdf, String filename) async {
final imageByteData = await rootBundle.load('assets/$filename');
// Convert ByteData to Uint8List
final imageUint8List = imageByteData.buffer.asUint8List(imageByteData.offsetInBytes, imageByteData.lengthInBytes);

final image = pw.MemoryImage(imageUint8List);
pdf.addPage(
  pw.Page(
    build: (pw.Context context) {
      return pw.Center(
        child: pw.Image(image),
      ); // Center
    },
  ),
);

}

i have tried this kind of solution didn't work as I want

so for examople if i have 3 files in pdf file I need to change each files to image and display it


问:
NextJS - You may need an appropriate loader to handle this file type - but I don't think that's what is actually going on
So I've got this error, but I don't actually think that's the problem, as I have a very similar setup, in another app. This is in a React Native Web/Expo/NextJS app based on this:

```<code> Module parse failed: Unexpected token (21:4)
 You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See
 https://webpack.js.org/concepts#loaders
 | const GeneralStatusBarColor = ({ backgroundColor, height,     ...props }) => {
 |   return (
 >     <SafeAreaView style={{ height: height, backgroundColor: backgroundColor }}>
 |       <StatusBar
 |         {...props}
</code>```

But, I have a .babelrc file, based off this repo, and some of my own changes:

https://github.com/GeekyAnts/nativebase-templates/tree/master/solito-universal-app-template-nativebase-typescript

```<code>{
  "presets": [
    "next/babel",
    ["babel-preset-expo", { "jsxRuntime": "automatic" }]
  ],
  "plugins": [
    ["@babel/plugin-proposal-class-properties", { "loose": true }],
    ["@babel/plugin-proposal-private-methods", { "loose": true }],
    ["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
    "react-native-reanimated/plugin",
    [
      "module-resolver",
      {
        "root": "../../packages",
        "alias": {
          "app": "../../packages/app",
          "components": "../../packages/app/components",
          "config": "../../packages/app/config",
          "controllers": "../../packages/app/controllers",
          "pages": "../../packages/app/pages",
          "features": "../../packages/app/features",
          "reducers": "../../packages/app/redux",
          "resources": "../../packages/app/resources",
          "revenuecat": "../../packages/app/revenuecat",
          "routing": "../../packages/app/routing",
          "utils": "../../packages/app/utils",
          "interfaces": "../../packages/app/interfaces",
          "root": "./"
        }
      }
    ]
  ]
}
</code>```

I also have a webpack definition in my next.config.js:

```<code>webpack: (config, options) => {
      config.resolve.alias = {
        ...(config.resolve.alias || {}),
        'react-native$': 'react-native-web',
        '@expo/vector-icons': 'react-native-vector-icons',
      };
      config.resolve.extensions = [
        '.web.js',
        '.web.ts',
        '.web.tsx',
        ...config.resolve.extensions,
      ];
      return config;
    }
</code>```

Now I can get rid of this error by adding more webpack code inside my next.config.js, but I have another app where I don't need this, and it works fine, and when I DO put loader code inside my webpack settings in next.config.js, it causes a whole lot of other issues.

So what exactly is going on here? Where could this loader problem be originating from?

Body:
So I've got this error, but I don't actually think that's the problem, as I have a very similar setup, in another app. This is in a React Native Web/Expo/NextJS app based on this:

 Module parse failed: Unexpected token (21:4)
 You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See
 https://webpack.js.org/concepts#loaders
 | const GeneralStatusBarColor = ({ backgroundColor, height,     ...props }) => {
 |   return (
 >     <SafeAreaView style={{ height: height, backgroundColor: backgroundColor }}>
 |       <StatusBar
 |         {...props}

But, I have a .babelrc file, based off this repo, and some of my own changes:

https://github.com/GeekyAnts/nativebase-templates/tree/master/solito-universal-app-template-nativebase-typescript

{
  "presets": [
    "next/babel",
    ["babel-preset-expo", { "jsxRuntime": "automatic" }]
  ],
  "plugins": [
    ["@babel/plugin-proposal-class-properties", { "loose": true }],
    ["@babel/plugin-proposal-private-methods", { "loose": true }],
    ["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
    "react-native-reanimated/plugin",
    [
      "module-resolver",
      {
        "root": "../../packages",
        "alias": {
          "app": "../../packages/app",
          "components": "../../packages/app/components",
          "config": "../../packages/app/config",
          "controllers": "../../packages/app/controllers",
          "pages": "../../packages/app/pages",
          "features": "../../packages/app/features",
          "reducers": "../../packages/app/redux",
          "resources": "../../packages/app/resources",
          "revenuecat": "../../packages/app/revenuecat",
          "routing": "../../packages/app/routing",
          "utils": "../../packages/app/utils",
          "interfaces": "../../packages/app/interfaces",
          "root": "./"
        }
      }
    ]
  ]
}

I also have a webpack definition in my next.config.js:

webpack: (config, options) => {
      config.resolve.alias = {
        ...(config.resolve.alias || {}),
        'react-native$': 'react-native-web',
        '@expo/vector-icons': 'react-native-vector-icons',
      };
      config.resolve.extensions = [
        '.web.js',
        '.web.ts',
        '.web.tsx',
        ...config.resolve.extensions,
      ];
      return config;
    }

Now I can get rid of this error by adding more webpack code inside my next.config.js, but I have another app where I don't need this, and it works fine, and when I DO put loader code inside my webpack settings in next.config.js, it causes a whole lot of other issues.

So what exactly is going on here? Where could this loader problem be originating from?


问:
Google payment method: Unable to add my debit card [ shows error - OR-CCSEH-21]
I am trying to add my VISA debit card to my payments method in Google for a couple of days now. When I try to add the card, I keep getting the following error:

Your request failed. Use a different payment method, or contact us. [OR-CCSEH-21]

I have tried adding other debit cards too, but I still get the same error. International transaction is enabled in my card; in fact I can perform transactions in any other foreign/national websites, so I don't think the issue is with my card.

I have also shared the screenshot with the Google payments support team. They've replied that they don't have any expertise on this issue and so will assign a specialist team on my case, but it has never been assigned till now.

Does anyone know how to resolve this issue? Any help will be appreciable.


问:
How to Allow Access to a user on a private repo via Api on Github?
There's a way to give access to a Github user passing his username or id to some API?
An another solution to automate access to the repo is welcome too.

Thanks!

I couldn't find any endpoint in the docs :/


问:
Black line showing on AdaptiveNavigationScaffold Flutter Windows
I am using the following AdaptiveNavigationScaffold implementation for a scaffold for a Windows flutter application...

```<code>  Widget build(BuildContext context) => AdaptiveNavigationScaffold(
        selectedIndex: StatefulShellRoute.of(context).currentIndex,
        drawerHeader: SizedBox(
          child: Container(
            color: Colors.red,
          ),
          height: 200,
          width: double.infinity,
        ),
        drawerScrimColor: Colors.white,
        backgroundColor: Colors.white,
        bottomNavigationOverflow: 10,
        body: ClipRect(child: child),
        onDestinationSelected: (int idx) => _goBranch(context, idx),
        destinations: branches.map((e) => e.adaptiveDestination).toList(),
      );
</code>```

Everything is working well with go_router for handling navigation/state/all that good stuff. The issue I'm experiencing is with this black line showing up, and I can't seem to figure out where it is coming from. I can confirm this issue is not present when running the app with a web target.

I've tried to configure all the parameters of the AdaptiveNavigationScaffold but have not had any luck.

Git report: https://github.com/material-components/material-components-flutter-adaptive/issues/66

Body:
I am using the following AdaptiveNavigationScaffold implementation for a scaffold for a Windows flutter application...

  Widget build(BuildContext context) => AdaptiveNavigationScaffold(
        selectedIndex: StatefulShellRoute.of(context).currentIndex,
        drawerHeader: SizedBox(
          child: Container(
            color: Colors.red,
          ),
          height: 200,
          width: double.infinity,
        ),
        drawerScrimColor: Colors.white,
        backgroundColor: Colors.white,
        bottomNavigationOverflow: 10,
        body: ClipRect(child: child),
        onDestinationSelected: (int idx) => _goBranch(context, idx),
        destinations: branches.map((e) => e.adaptiveDestination).toList(),
      );

Everything is working well with go_router for handling navigation/state/all that good stuff. The issue I'm experiencing is with this black line showing up, and I can't seem to figure out where it is coming from. I can confirm this issue is not present when running the app with a web target.

I've tried to configure all the parameters of the AdaptiveNavigationScaffold but have not had any luck.

Git report: https://github.com/material-components/material-components-flutter-adaptive/issues/66


问:
Adding logout timer to spring security application
I created one of the spring application project (a simple login form). where I recently added "logout" functionality. I was wondering how to add a logout timer so the user will be logged out fo inactivity after a certain interval of time. I tried looking resource on stack overflow as well as spring documentation but couldn't find one. Please note that I am using ALL JAVA CONFIGURATION (NO XML bsaed configuration).

So far I have designed a simple login functionality, which works as desired but I am trying refactor the "logout functionality" so user won't have to click on logout functionality all the time. I am attaching link for my codebase, please review it.

project: https://drive.google.com/file/d/1K1yhxsrUWxJe6iaeEL_Pj2HJ9C41vYaT/view?usp=share_link

*Note
while importing my project from DRIVE, you will have to add tomcat server (v9.0) and add the path of the server in the project as well.


问:
Save Printed Documents Record in Database
i have developed a program for printing student and staff ID Cards in PhP. i want to print ID Card and store in MYSQL database that the ID Card is printed how many number of times and on which data.

I try nothing as i have no idea and don't know what to do


问:
Unity catalog on azure databricks external table upgrade fails with below error
Is anyone came across below issue during unity catalog table upgrade

we have configured unity catalog in azure and assigned one workspace

added external location and credentials in unity catalog

Assigned create permission on external location

Metastore created is using Azure Gen2

Location assigned in abfss path and connection test looks good

when we try to upgrade one table we are getting below error

[UPGRADE_NOT_SUPPORTED.UNSUPPORTED_FILE_SCHEME] Table is not eligible for upgrade from Hive Metastore to Unity Catalog. Reason: Unsupported file system scheme wasbs.

I am not seeing any issue in terms of unity catalog, do we have any pre-requisites on source /mnt, as it uses wasbs.  usually it should not consider that as we are upgrading our external table using external credential that was configured

do we need to convert existing mount to abfss format before starting unity catalog external table upgrade, i am not seeing any reason

we have tried to updated table properties and tested pre-requistes


问:
Apex line chart overflowing on first render and if anything changed it goes back to normal
I'm using MUI and in there used ApexChart, but in case of line chart, the chart is overflowing, and makes the horizontal scroll appear. Here is the attached image:

If any state is changed in the page the width goes back to normal and the horizontal scroll goes back to normal. Here is the after image

And here are the options I'm using with the chart:

```<code>  <Card sx={{ maxWidth: "xl" }}>
      <CardContent
        sx={{
          "& .apexcharts-xaxis-label": { fontSize: "0.875rem" },
          "& .apexcharts-canvas svg": {
            maxWidth: "100%",
          },
        }}
      >
        <ReactApexChart
          type="line"
          height={206}
          options={options}
          width={"100%"}
          series={[
            {
              name: "Total Responses",
              data: [700, 258, 530, 240, 610, 400, 100, 610, 700],
            },
          ]}
        />
      </CardContent>
    </Card>

const options = {
    chart: {
      parentHeightOffset: 0,
      toolbar: { show: false },
      width: "100%",
    },
    fill: {
      type: "gradient",
      gradient: {
        opacityTo: 0.2,
        opacityFrom: 1,
        shadeIntensity: 0,
        type: "horizontal",
        stops: [0, 100, 100],
      },
    },
    stroke: {
      width: 5,
      //   curve: "smooth",
      //   lineCap: "round",
    },
    legend: { show: false },
    colors: [theme.palette.warning.main],
    grid: {
      strokeDashArray: 7,
      padding: {
        top: -1,
        right: 0,
        // left: -12,
        bottom: 5,
      },
    },
    xaxis: {
      axisTicks: { show: false },
      axisBorder: { show: false },
      categories: [
        "Jan",
        "Feb",
        "Mar",
        "Apr",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Nov",
        "Dec",
      ],
    },
    yaxis: {
      show: true,
    },
  };
</code>```

I'm expecting the chart to always take the 100% width of its container and not to overflow.

Body:
I'm using MUI and in there used ApexChart, but in case of line chart, the chart is overflowing, and makes the horizontal scroll appear. Here is the attached image:

If any state is changed in the page the width goes back to normal and the horizontal scroll goes back to normal. Here is the after image

And here are the options I'm using with the chart:

  <Card sx={{ maxWidth: "xl" }}>
      <CardContent
        sx={{
          "& .apexcharts-xaxis-label": { fontSize: "0.875rem" },
          "& .apexcharts-canvas svg": {
            maxWidth: "100%",
          },
        }}
      >
        <ReactApexChart
          type="line"
          height={206}
          options={options}
          width={"100%"}
          series={[
            {
              name: "Total Responses",
              data: [700, 258, 530, 240, 610, 400, 100, 610, 700],
            },
          ]}
        />
      </CardContent>
    </Card>

const options = {
    chart: {
      parentHeightOffset: 0,
      toolbar: { show: false },
      width: "100%",
    },
    fill: {
      type: "gradient",
      gradient: {
        opacityTo: 0.2,
        opacityFrom: 1,
        shadeIntensity: 0,
        type: "horizontal",
        stops: [0, 100, 100],
      },
    },
    stroke: {
      width: 5,
      //   curve: "smooth",
      //   lineCap: "round",
    },
    legend: { show: false },
    colors: [theme.palette.warning.main],
    grid: {
      strokeDashArray: 7,
      padding: {
        top: -1,
        right: 0,
        // left: -12,
        bottom: 5,
      },
    },
    xaxis: {
      axisTicks: { show: false },
      axisBorder: { show: false },
      categories: [
        "Jan",
        "Feb",
        "Mar",
        "Apr",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Nov",
        "Dec",
      ],
    },
    yaxis: {
      show: true,
    },
  };

I'm expecting the chart to always take the 100% width of its container and not to overflow.


问:
How to remove the path in the import if it has an alias, automatically and throughout the project?
I don't want the project to have full paths in the imports, if it is possible to use aliases.

For example, I have import:

import { DropDownFilters } from '../../../../../uikit/DropDownFilters'

I want to write it as:

'import { DropDownFilters } from uikit/DropDownFilters'

I don't want to walk around the project manually and fix things like that, I want to configure eslint so that it fixes it itself or at least highlights the problems


问:
LINQ query throw an exception when to get a count of a type
I write a test to filter a list.

Service.cs

```<code>public async Task<GetAllParticipantsDto> ListAllAsync(GetAllParticipantsRequest queryModel)
{
    int count = 0;

    var participantsList = participantRepository.AsNoTracking()
            .Include(a => a.ParticipantConnections)!.ThenInclude(a => a.Connection)
            .Include(a => a.ParticipantApplicationUsers)!.ThenInclude(a => a.ApplicationUser)
            .AsQueryable();

    if (participantsList != null && !String.IsNullOrEmpty(queryModel.RelatedConnection))
    {
        participantsList = participantsList.Where(x => x.ParticipantConnections.Any(y => y.Connection.FirstName.ToLower().Contains(queryModel.RelatedConnection.ToLower())) || x.ParticipantConnections.Any(y => y.Connection.LastName.ToLower().Contains(queryModel.RelatedConnection.ToLower())) ||
        x.ParticipantConnections.Any(y => (y.Connection.FirstName.ToLower()+ y.Connection.LastName.ToLower()).Contains(queryModel.RelatedConnection.ToLower())) || x.ParticipantConnections.Any(y => (y.Connection.FirstName.ToLower() +" "+ y.Connection.LastName.ToLower()).Contains(queryModel.RelatedConnection.ToLower())));
        count = participantsList.Count(); //  NullReferenceException Exception thrown in this line
    }
}
</code>```

unit test

```<code>public async void ListAllAsync_ShouldReturn_FilterByBy_RelatedConnection()
{
    var query = new GetAllParticipantsRequest()
    {   // others null
        RelatedConnection = "Alice Doe, Bob Doe"
    };
    Func<DSMP.ApplicationCore.Entities.Participant, bool> exists = n => true;  // prepare Func outside of Setup

    //1 - create a List<T> with test items
    var participantList = ParticipantMockData.ListAllAsyncEntity();

    //2 - build mock by extension
    var mock = participantList.AsQueryable().BuildMock();

    //3 - setup the mock as Queryable for Moq
    _participantRepository.Setup(x => x.AsNoTracking(false)).Returns(mock);

    var sut = new ParticipantService(
        _participantRepository.Object, _participantSupportNeed.Object, _participantConnection.Object, _participantDisability.Object, _participantMedicalCondition.Object, _supportNeed.Object, _disability.Object, _medicalCondition.Object, _participantApplicationUser.Object, _appLogger.Object);

    // Act
    var result = await sut.ListAllAsync(query);

    // Assert
}
</code>```

The exception

Message - System.NullReferenceException: 'Object reference not set to an instance of an object.'

StackTrace -
"   at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)\r\n   at System.Linq.Enumerable.WhereListIterator1.MoveNext()\r\n   at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items)\r\n   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source)\r\n   at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)\r\n   at System.Linq.SystemCore_EnumerableDebugView1.get_Items()"

I could not find why this error occur.
Can any one help me?

Body:
I write a test to filter a list.

Service.cs

public async Task<GetAllParticipantsDto> ListAllAsync(GetAllParticipantsRequest queryModel)
{
    int count = 0;

    var participantsList = participantRepository.AsNoTracking()
            .Include(a => a.ParticipantConnections)!.ThenInclude(a => a.Connection)
            .Include(a => a.ParticipantApplicationUsers)!.ThenInclude(a => a.ApplicationUser)
            .AsQueryable();

    if (participantsList != null && !String.IsNullOrEmpty(queryModel.RelatedConnection))
    {
        participantsList = participantsList.Where(x => x.ParticipantConnections.Any(y => y.Connection.FirstName.ToLower().Contains(queryModel.RelatedConnection.ToLower())) || x.ParticipantConnections.Any(y => y.Connection.LastName.ToLower().Contains(queryModel.RelatedConnection.ToLower())) ||
        x.ParticipantConnections.Any(y => (y.Connection.FirstName.ToLower()+ y.Connection.LastName.ToLower()).Contains(queryModel.RelatedConnection.ToLower())) || x.ParticipantConnections.Any(y => (y.Connection.FirstName.ToLower() +" "+ y.Connection.LastName.ToLower()).Contains(queryModel.RelatedConnection.ToLower())));
        count = participantsList.Count(); //  NullReferenceException Exception thrown in this line
    }
}

unit test

public async void ListAllAsync_ShouldReturn_FilterByBy_RelatedConnection()
{
    var query = new GetAllParticipantsRequest()
    {   // others null
        RelatedConnection = "Alice Doe, Bob Doe"
    };
    Func<DSMP.ApplicationCore.Entities.Participant, bool> exists = n => true;  // prepare Func outside of Setup

    //1 - create a List<T> with test items
    var participantList = ParticipantMockData.ListAllAsyncEntity();

    //2 - build mock by extension
    var mock = participantList.AsQueryable().BuildMock();

    //3 - setup the mock as Queryable for Moq
    _participantRepository.Setup(x => x.AsNoTracking(false)).Returns(mock);

    var sut = new ParticipantService(
        _participantRepository.Object, _participantSupportNeed.Object, _participantConnection.Object, _participantDisability.Object, _participantMedicalCondition.Object, _supportNeed.Object, _disability.Object, _medicalCondition.Object, _participantApplicationUser.Object, _appLogger.Object);

    // Act
    var result = await sut.ListAllAsync(query);

    // Assert
}

The exception

Message - System.NullReferenceException: 'Object reference not set to an instance of an object.'

StackTrace -
"   at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)\r\n   at System.Linq.Enumerable.WhereListIterator1.MoveNext()\r\n   at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items)\r\n   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source)\r\n   at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)\r\n   at System.Linq.SystemCore_EnumerableDebugView1.get_Items()"

I could not find why this error occur.
Can any one help me?


问:
Need some advice about handling 302 redirects with network error(using fetch)
Our Network work like this.

1 GET 302

2 302 redirects with network error

3 GET 302

4 302 redirects

```<code>  fetch(`our Backend which is calling google login`, {
    redirect: 'manual',
  })
    .then((res) => {
        // trigger network error here!!! window.location.href = res.url;
      if (res.type === 'opaqueredirect') {
        window.location.href = res.url;
      } else {
      }
    })
</code>```

All possible ways coding that I write is not working.
Our backend use 'header.Access-Control-Allow~~~'. So we can't use '*' related CORS policy in Backend.
How can I fix the frontend or backend so it doesn't cause network errors?

Body:
Our Network work like this.

1 GET 302

2 302 redirects with network error

3 GET 302

4 302 redirects

  fetch(`our Backend which is calling google login`, {
    redirect: 'manual',
  })
    .then((res) => {
        // trigger network error here!!! window.location.href = res.url;
      if (res.type === 'opaqueredirect') {
        window.location.href = res.url;
      } else {
      }
    })

All possible ways coding that I write is not working.
Our backend use 'header.Access-Control-Allow~~~'. So we can't use '*' related CORS policy in Backend.
How can I fix the frontend or backend so it doesn't cause network errors?


问:
Error: No repository for "AuditLogEntity" was found. Looks like this entity is not registered in current "default" connection? Typeorm
I created a new module in my codebase called as AuditLog, created using nest CLI and i get this error when i compile the code (nest start)
I created it inside src folder (refer screen shot),
here's my ormConfig

```<code>module.exports = {
  type: 'postgres',
  host: host || 'localhost',
  username: username || 'postgres',
  password: password || 'secret',
  port: port || '5432',
  database: pathname || 'dbname',
  entities: ['src/**/*.entity.ts'],
  migrationsTableName: 'migrations',
  migrations: [`src/db/${migrationDir}/*.ts`],
  cli: {
    entitiesDir: 'src/*/',
    migrationsDir: `src/db/${migrationDir}`
  },
  ssl: process.env.NODE_ENV === 'production'
    ? { rejectUnauthorized: false }
    : false
};
</code>```

Here's my entity definition

```<code>import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm';

@Entity('auditlog')
export class AuditLogEntity extends BaseEntity {
  @PrimaryColumn('uuid')
  id: string;

  @Column()
  entityId: string;

  @Column({ type: 'json' })
  oldValue: Record<string, any>;

  @Column()
  entityType: string;

  @Column()
  updatedAt: Date;
}
</code>```

Module code

```<code>import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuditLogEntity } from './audit-log.entity';
import { AuditLogController } from './audit-log.controller';
import { AuditLogService } from './audit-log.service';

@Module({
  imports: [TypeOrmModule.forFeature([AuditLogEntity])],
  controllers: [AuditLogController],
  providers: [AuditLogService]
})
export class AuditLogModule {}
</code>```

controller

```<code>import { Controller, Get } from '@nestjs/common';
import { AuditLogEntity } from './audit-log.entity';
import { AuditLogService } from './audit-log.service';

@Controller('api/audit-log')
export class AuditLogController {
  constructor(private readonly auditLogService: AuditLogService) {}

  @Get()
  public async createAudit() {
    const auditEntity = new AuditLogEntity();
    // put this inside a static method that returns AuditLogEntity object taking AuditLogDto
    auditEntity.entityId = '01b44c5d-158c-4719-806d-966652d408dc';
    auditEntity.entityType = 'order';
    auditEntity.oldValue = {
      transporterId: '7d07b3e3-bd1f-4209-a1fa-414c5a019f52', // t04
      phoneNumber: 9876534201
    };
    auditEntity.updatedAt = new Date();

    return await this.auditLogService.addAuditEntity(auditEntity);
  }
}
</code>```

service file

```<code>import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { AuditLogDto } from './audit-log.dto';
import { AuditLogEntity } from './audit-log.entity';

@Injectable()
export class AuditLogService {
  constructor(
    @InjectRepository(AuditLogEntity) private readonly auditRepository: Repository<AuditLogEntity>
  ) {}

  public async addAuditEntity(auditEntity: AuditLogEntity): Promise<AuditLogEntity> {
    return await this.auditRepository.save(auditEntity);
  }
}
</code>```

i have imported this module in app.module.ts too but still getting this error
Please help me here ...

 please refer this file structure if required

Body:
I created a new module in my codebase called as AuditLog, created using nest CLI and i get this error when i compile the code (nest start)
I created it inside src folder (refer screen shot),
here's my ormConfig

module.exports = {
  type: 'postgres',
  host: host || 'localhost',
  username: username || 'postgres',
  password: password || 'secret',
  port: port || '5432',
  database: pathname || 'dbname',
  entities: ['src/**/*.entity.ts'],
  migrationsTableName: 'migrations',
  migrations: [`src/db/${migrationDir}/*.ts`],
  cli: {
    entitiesDir: 'src/*/',
    migrationsDir: `src/db/${migrationDir}`
  },
  ssl: process.env.NODE_ENV === 'production'
    ? { rejectUnauthorized: false }
    : false
};

Here's my entity definition

import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm';

@Entity('auditlog')
export class AuditLogEntity extends BaseEntity {
  @PrimaryColumn('uuid')
  id: string;

  @Column()
  entityId: string;

  @Column({ type: 'json' })
  oldValue: Record<string, any>;

  @Column()
  entityType: string;

  @Column()
  updatedAt: Date;
}

Module code

import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuditLogEntity } from './audit-log.entity';
import { AuditLogController } from './audit-log.controller';
import { AuditLogService } from './audit-log.service';

@Module({
  imports: [TypeOrmModule.forFeature([AuditLogEntity])],
  controllers: [AuditLogController],
  providers: [AuditLogService]
})
export class AuditLogModule {}

controller

import { Controller, Get } from '@nestjs/common';
import { AuditLogEntity } from './audit-log.entity';
import { AuditLogService } from './audit-log.service';

@Controller('api/audit-log')
export class AuditLogController {
  constructor(private readonly auditLogService: AuditLogService) {}

  @Get()
  public async createAudit() {
    const auditEntity = new AuditLogEntity();
    // put this inside a static method that returns AuditLogEntity object taking AuditLogDto
    auditEntity.entityId = '01b44c5d-158c-4719-806d-966652d408dc';
    auditEntity.entityType = 'order';
    auditEntity.oldValue = {
      transporterId: '7d07b3e3-bd1f-4209-a1fa-414c5a019f52', // t04
      phoneNumber: 9876534201
    };
    auditEntity.updatedAt = new Date();

    return await this.auditLogService.addAuditEntity(auditEntity);
  }
}

service file

import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { AuditLogDto } from './audit-log.dto';
import { AuditLogEntity } from './audit-log.entity';

@Injectable()
export class AuditLogService {
  constructor(
    @InjectRepository(AuditLogEntity) private readonly auditRepository: Repository<AuditLogEntity>
  ) {}

  public async addAuditEntity(auditEntity: AuditLogEntity): Promise<AuditLogEntity> {
    return await this.auditRepository.save(auditEntity);
  }
}

i have imported this module in app.module.ts too but still getting this error
Please help me here ...

 please refer this file structure if required


问:
How to make a coroutine synchronous in ipython?
I have an async method:

async def my_async_method():
  return await asyncio.sleep(3)
```
<p>that I want to make synchronous with a timeout.</p>
<p>This fine works with <code>run_until_complete</code> if the loop is not already running.</p>
<pre class="lang-py prettyprint-override"><code>def run_with_timeout(loop, f, timeout):
    try:
        result = loop.run_until_complete(asyncio.wait_for(f, timeout=timeout))
    except asyncio.TimeoutError:
        raise TimeoutError("Timed out waiting for data")
    return result
</code>```

However, in IPython, the loop is always running. I tried adding my coroutine as a task, but the docs mention the following

In Terminal IPython background tasks are only processed while the foreground task is running, if and only if the foreground task is async:

https://ipython.readthedocs.io/en/stable/interactive/autoawait.html

I could use a busy wait, but that seems suboptimal, especially for non-ipython environments.

How do I make run_with_timeout work in both a normal repl and ipython?

Body:
I have an async method:

async def my_async_method():
  return await asyncio.sleep(3)

that I want to make synchronous with a timeout.

This fine works with run_until_complete if the loop is not already running.

def run_with_timeout(loop, f, timeout):
    try:
        result = loop.run_until_complete(asyncio.wait_for(f, timeout=timeout))
    except asyncio.TimeoutError:
        raise TimeoutError("Timed out waiting for data")
    return result

However, in IPython, the loop is always running. I tried adding my coroutine as a task, but the docs mention the following

In Terminal IPython background tasks are only processed while the foreground task is running, if and only if the foreground task is async:

https://ipython.readthedocs.io/en/stable/interactive/autoawait.html

I could use a busy wait, but that seems suboptimal, especially for non-ipython environments.

How do I make run_with_timeout work in both a normal repl and ipython?


问:
Neo4j GraphQL how to check if node exists before connecting to it
B"H

I've seen this question and I want to do the same thing with the GraphQL driver for Neo4j. I think the answer lies somewhere in combining AND and OR operators found here, of some sort, but not sure how.

To illustrate the question, say I have this type:

```<code>
type Comment  {
    id: ID @id
    timeAdded: DateTime! @timestamp(
        operations: [CREATE]
    )
    writer: User! @relationship(
        type: "WRITTEN_BY",
        direction: IN
    )
    content: String
}

type User {
   id: ID @id
   name: String
   commentsWritten: [Comment!]! @relationship(
        type: "WRITTEN_BY",
        direction: OUT
    )
}

type Mutation {
    addComment(authorID: String)
}

</code>```

and this resolver to add a new comment (where "Comment" is a reference to the OGM model of the Comment type):

```<code>addComment: async (
        src,
        args,
        ctx
    ) => {

        var authorID = args/*edit*/.authorID //let's say this is passed
                 //from request headers / JWT token or something

        var adCom = await Comment.create({
            input: [
                {
                    content: args.content,
                    writer: {
                        connect: {
                            where: {
                                node: {
                                    users: {
                                        id: authorID
                                    }
                                }
                            }
                        }
                    }
                }
            ]
        })

        return adCom;
    }
</code>```

So it attempts to connect to that user with that ID. but if there is no user with that ID, I don't want to create anything [not only do I not want to connect it].

I could run another query to find a User with that ID, and test if it went through, but was wondering if it's possible to do everything in one call

Body:
B"H

I've seen this question and I want to do the same thing with the GraphQL driver for Neo4j. I think the answer lies somewhere in combining AND and OR operators found here, of some sort, but not sure how.

To illustrate the question, say I have this type:

type Comment  {
    id: ID @id
    timeAdded: DateTime! @timestamp(
        operations: [CREATE]
    )
    writer: User! @relationship(
        type: "WRITTEN_BY",
        direction: IN
    )
    content: String
}

type User {
   id: ID @id
   name: String
   commentsWritten: [Comment!]! @relationship(
        type: "WRITTEN_BY",
        direction: OUT
    )
}

type Mutation {
    addComment(authorID: String)
}

and this resolver to add a new comment (where "Comment" is a reference to the OGM model of the Comment type):

addComment: async (
        src,
        args,
        ctx
    ) => {

        var authorID = args/*edit*/.authorID //let's say this is passed
                 //from request headers / JWT token or something

        var adCom = await Comment.create({
            input: [
                {
                    content: args.content,
                    writer: {
                        connect: {
                            where: {
                                node: {
                                    users: {
                                        id: authorID
                                    }
                                }
                            }
                        }
                    }
                }
            ]
        })

        return adCom;
    }

So it attempts to connect to that user with that ID. but if there is no user with that ID, I don't want to create anything [not only do I not want to connect it].

I could run another query to find a User with that ID, and test if it went through, but was wondering if it's possible to do everything in one call


问:
Creating xl hyperlinks from AWS pdf files
Im looking for some help in creating hyperlinks from publicly available data that is on a webpage. The webpage is only serving up 10 searches / pdf links at the time which is not very helpful for what I would like to do, which is create a list of all PDF files and their links.

A typical link is in this format below, which I have tried in xl and from doing some basic research expect is problematic for xl in being too long. It's also got some function that times out and has a credential check with AWS that returns an error message when tried i other platforms such as word etc...

https://qbcc-services-api-adjudication-decisions-production.s3.ap-southeast-2.amazonaws.com/00000001406600_1.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA54ULEG4LURTRQNJX%2F20221223%2Fap-southeast-2%2Fs3%2Faws4_request&X-Amz-Date=20221223T051031Z&X-Amz-Expires=120&X-Amz-Signature=513af3f48e24ff336c77ed63154292ad98ef7fe991c3538768b7709d8ba9cf69&X-Amz-SignedHeaders=host

Any ideas on how to create a list with hyperlinks with this sort of link. The key data to identify the pdf is 00000001406600_1.pdf which I have in an xl list already. There are upwards of 5000 pdf's that I'm trying to make a more convenient list of so I can search and filter etc...

Tried creating a concatenated version of the link in xl, the link is too long to work properly being longer than 255 characters. Tried access, word and got credential blocked / timeout. I don't know anything about AWS and their credential checks / timeouts etc...


问:
NGINX SERVER WITH PHP 7.4 cannot install CMS on a SUBDOMAIN
I have a Sub Domain"

ad.example.com and I am trying to install a CMS and it get stuck at install.php with a 404 not Found error

server {
access_log /var/log/nginx/ad.example.com.access.log;

```<code>error_log /var/log/nginx/ad.example.com.error.log;

listen 8000;
#listen [::]:80 default_server;
server_name  ad.example.com;
root   /usr/local/www/ad.example.com/html;

location / {
   index  index.php index.html index.htm;
   try_files $uri $uri/ /index.php?$args;

}
location ~ \.php$ {

     fastcgi_split_path_info ^(.+\.php)(/.+)$;

     fastcgi_pass   unix:/var/run/php-fpm.sock;
     fastcgi_index  index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include        fastcgi_params;
}
</code>```

Although i can check ad.example.com/info.php it works but ad.example.com/www/admin/info.php does not work ad.example.com/www/admin/install.php 404 Error Not Found

I tried all the relevant NGINX and PHP config available on various Website and Internet Source still no solution

Body:
I have a Sub Domain"

ad.example.com and I am trying to install a CMS and it get stuck at install.php with a 404 not Found error

server {
access_log /var/log/nginx/ad.example.com.access.log;

error_log /var/log/nginx/ad.example.com.error.log;

listen 8000;
#listen [::]:80 default_server;
server_name  ad.example.com;
root   /usr/local/www/ad.example.com/html;

location / {
   index  index.php index.html index.htm;
   try_files $uri $uri/ /index.php?$args;

}
location ~ \.php$ {

     fastcgi_split_path_info ^(.+\.php)(/.+)$;

     fastcgi_pass   unix:/var/run/php-fpm.sock;
     fastcgi_index  index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include        fastcgi_params;
}

Although i can check ad.example.com/info.php it works but ad.example.com/www/admin/info.php does not work ad.example.com/www/admin/install.php 404 Error Not Found

I tried all the relevant NGINX and PHP config available on various Website and Internet Source still no solution


问:
How to add new entities to frontend and backend?
We have separated frontend and backend and used the jhipster --skip-server command to create frontend and used jhipster --skip-client to create backend service.

Now we would like to add more entities to frontend and backend.

So, how to generate separate frontend and backend code for an entity?

Gateway is the only backend service we have now. Postgres is our relational database.

jHipster registry is also installed to monitor services.


问:
(JScript) Complex Tree Logic with more than one root
I'm facing a deadend on building the logic of my complex tree-like structure where it has more than 1 source/root and many interconnected intersections. To make it easy to explain, I include the mini version of the actual content with the logic as intended.

There are several main things to look at here:

button #1 and #7 is the starting point, where there are no pre-requisite for activating them

when there is a button de-activated, the rest with no source linked will be de-activated

the logic becomes complex when the situation get complex

Below here are the example of complex situations

symbols:

 = active

O = inactive

======================

O==================

====================

======O=========O

=================O====

lets say I de-activate #6, it will become like this:

======================

O==================

===========O=========

======O=========O

=================O====

What I can do is telling #10 to check wether #6 or #9 is active, if it's not then set #10 inactive. another situation is like below:

======================

O==================

====O================

============O===O

=================O====

and then I turn off #6

======================

O==================

====O=======O=========

============O===O

=================O====

This situation is far more complex than the 1st one, #2 has 3 sources to check, which are #1, #5, and #3. #1 and #5 are false, however #3 is true, thus, it becomes complex because doesn't know where to check from or multiple checking, it needs to check #3, #4, #6, to make sure there is a source of "power" coming from that side.

This sample is only around 1% of my whole project, any shorter logic are welcome.

Please try on the snippets first to grasp the concept.

var cvs = document.getElementById('mycanvas');
var ctx = cvs.getContext('2d');
var actives = [];
for (var i = 1; i < 14; i++) {
  actives.push(false);
};

drawLine(document.getElementById('b1'),document.getElementById('b4'));
drawLine(document.getElementById('b2'),document.getElementById('b8'));
drawLine(document.getElementById('b7'),document.getElementById('b12'));
drawLine(document.getElementById('b4'),document.getElementById('b10'));
drawLine(document.getElementById('b11'),document.getElementById('b13'));

function toogle(event){
  actives[(event.target.innerHTML)] = !actives[(event.target.innerHTML)];
  logic();
  visual();
}

function visual(){
    var buttons = document.getElementsByTagName("button");
    for (var i = 1; i < buttons.length + 1; i++){
    if (actives[i]) {
      buttons[(i-1)].style.backgroundColor = 'pink';
    } else {
      buttons[(i-1)].style.backgroundColor = '';
    }
  }
}

function logic(){
    if (actives[8] == false && actives[10] == false) {
  actives[9] = false;
}
if (actives[2] == false && actives[10] == false) {
  actives[3] = false;
  actives[4] = false;
  actives[6] = false;
}
if (actives[2] == false && actives[7] == false) {
  for (var i = 0; i < 14; i++) {
    if (i != 1) {
      actives[i] = false;
    }
  }
}
//[][]
if (actives[2] == false && actives[8] == false) {
  /* not working, not sure why?
  for (var i = 0; i < 14; i++) {
    if (i != 7 || i != 1) {
      actives[i] = false;
    }
  }
  */
  actives[3] = false;
  actives[4] = false;
  actives[5] = false;
  actives[6] = false;
  actives[9] = false;
  actives[10] = false;
  actives[11] = false;
  actives[12] = false;
  actives[13] = false;
}
if (actives[9] == false && actives[4] == false) {
  actives[6] = false;
}
if (actives[4] == false && actives[10] == false) {
  actives[6] = false;
}
if (actives[3] == false && actives[10] == false) {
  actives[4] = false;
  actives[6] = false;
}
if (actives[2] == false && actives[8] == false) {
  actives[5] = false;
}
if (actives[9] == false && actives[6] == false) {
  actives[10] = false;
}
if (actives[7] == false && actives[5] == false && actives[9] == false) {
  actives[8] = false;
}
if (actives[3] == false && actives[6] == false) {
  actives[4] = false;
}
if (actives[2] == false && actives[4] == false) {
  actives[3] = false;
}
if (actives[10] == false) {
  actives[11] = false;
  actives[13] = false;
  actives[12] = false;
}
if (actives[1] == false && actives[5] == false && actives[6] == false) {
  actives[2] = false;
  actives[3] = false;
  actives[4] = false;
}
if (actives[1] == false && actives[5] == false && actives[10] == false) {
  actives[2] = false;
  actives[3] = false;
  actives[4] = false;
  actives[6] = false;
}
if (actives[1] == false && actives[8] == false) {
  actives[2] = false;
  actives[3] = false;
  actives[4] = false;
  actives[5] = false;
  actives[6] = false;
  actives[9] = false;
  actives[10] = false;
  actives[11] = false;
  actives[12] = false;
  actives[13] = false;
}
if (actives[1] == false && actives[7] == false) {
  for (var i = 0; i < 14; i++) {
    actives[i] = false;
  }
}
}

function drawLine(a,b){
      ctx.beginPath();
      ctx.moveTo(a.offsetLeft+25,a.offsetTop+25);
      ctx.lineTo(b.offsetLeft+25,b.offsetTop+25);
      ctx.lineWidth = 1.5;
      ctx.strokeStyle = 'black';
      ctx.stroke();
  }```
<pre class="snippet-code-css lang-css prettyprint-override"><code>* {
    margin: 0px;
    padding: 0px;
  }

  button {
    position: absolute;
    border-radius: 50%;
  }</code>```

<!DOCTYPE html>
<meta name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="style.css">

<canvas id='mycanvas' width="500" height="500"></canvas>
<button id="b1" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 20px;">1</button>
<button id="b2" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 90px;">2</button>
<button id="b3" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 160px;">3</button>
<button id="b4" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 230px;">4</button>
<button id="b5" onclick="toogle(event)" style="width: 50px; height: 50px; top: 90px; left: 90px;">5</button>
<button id="b6" onclick="toogle(event)" style="width: 50px; height: 50px; top: 90px; left: 230px;">6</button>
<button id="b7" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 20px;">7</button>
<button id="b8" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 90px;">8</button>
<button id="b9" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 160px;">9</button>
<button id="b10" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 230px;">10</button>
<button id="b11" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 300px;">11</button>
<button id="b12" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 370px;">12</button>
<button id="b13" onclick="toogle(event)" style="width: 50px; height: 50px; top: 230px; left: 300px;">13</button>

```

Body:
I'm facing a deadend on building the logic of my complex tree-like structure where it has more than 1 source/root and many interconnected intersections. To make it easy to explain, I include the mini version of the actual content with the logic as intended.

There are several main things to look at here:

button #1 and #7 is the starting point, where there are no pre-requisite for activating them

when there is a button de-activated, the rest with no source linked will be de-activated

the logic becomes complex when the situation get complex

Below here are the example of complex situations

symbols:

 = active

O = inactive

======================

O==================

====================

======O=========O

=================O====

lets say I de-activate #6, it will become like this:

======================

O==================

===========O=========

======O=========O

=================O====

What I can do is telling #10 to check wether #6 or #9 is active, if it's not then set #10 inactive. another situation is like below:

======================

O==================

====O================

============O===O

=================O====

and then I turn off #6

======================

O==================

====O=======O=========

============O===O

=================O====

This situation is far more complex than the 1st one, #2 has 3 sources to check, which are #1, #5, and #3. #1 and #5 are false, however #3 is true, thus, it becomes complex because doesn't know where to check from or multiple checking, it needs to check #3, #4, #6, to make sure there is a source of "power" coming from that side.

This sample is only around 1% of my whole project, any shorter logic are welcome.

Please try on the snippets first to grasp the concept.

var cvs = document.getElementById('mycanvas');
var ctx = cvs.getContext('2d');
var actives = [];
for (var i = 1; i < 14; i++) {
  actives.push(false);
};

drawLine(document.getElementById('b1'),document.getElementById('b4'));
drawLine(document.getElementById('b2'),document.getElementById('b8'));
drawLine(document.getElementById('b7'),document.getElementById('b12'));
drawLine(document.getElementById('b4'),document.getElementById('b10'));
drawLine(document.getElementById('b11'),document.getElementById('b13'));

function toogle(event){
  actives[(event.target.innerHTML)] = !actives[(event.target.innerHTML)];
  logic();
  visual();
}

function visual(){
    var buttons = document.getElementsByTagName("button");
    for (var i = 1; i < buttons.length + 1; i++){
    if (actives[i]) {
      buttons[(i-1)].style.backgroundColor = 'pink';
    } else {
      buttons[(i-1)].style.backgroundColor = '';
    }
  }
}

function logic(){
    if (actives[8] == false && actives[10] == false) {
  actives[9] = false;
}
if (actives[2] == false && actives[10] == false) {
  actives[3] = false;
  actives[4] = false;
  actives[6] = false;
}
if (actives[2] == false && actives[7] == false) {
  for (var i = 0; i < 14; i++) {
    if (i != 1) {
      actives[i] = false;
    }
  }
}
//[][]
if (actives[2] == false && actives[8] == false) {
  /* not working, not sure why?
  for (var i = 0; i < 14; i++) {
    if (i != 7 || i != 1) {
      actives[i] = false;
    }
  }
  */
  actives[3] = false;
  actives[4] = false;
  actives[5] = false;
  actives[6] = false;
  actives[9] = false;
  actives[10] = false;
  actives[11] = false;
  actives[12] = false;
  actives[13] = false;
}
if (actives[9] == false && actives[4] == false) {
  actives[6] = false;
}
if (actives[4] == false && actives[10] == false) {
  actives[6] = false;
}
if (actives[3] == false && actives[10] == false) {
  actives[4] = false;
  actives[6] = false;
}
if (actives[2] == false && actives[8] == false) {
  actives[5] = false;
}
if (actives[9] == false && actives[6] == false) {
  actives[10] = false;
}
if (actives[7] == false && actives[5] == false && actives[9] == false) {
  actives[8] = false;
}
if (actives[3] == false && actives[6] == false) {
  actives[4] = false;
}
if (actives[2] == false && actives[4] == false) {
  actives[3] = false;
}
if (actives[10] == false) {
  actives[11] = false;
  actives[13] = false;
  actives[12] = false;
}
if (actives[1] == false && actives[5] == false && actives[6] == false) {
  actives[2] = false;
  actives[3] = false;
  actives[4] = false;
}
if (actives[1] == false && actives[5] == false && actives[10] == false) {
  actives[2] = false;
  actives[3] = false;
  actives[4] = false;
  actives[6] = false;
}
if (actives[1] == false && actives[8] == false) {
  actives[2] = false;
  actives[3] = false;
  actives[4] = false;
  actives[5] = false;
  actives[6] = false;
  actives[9] = false;
  actives[10] = false;
  actives[11] = false;
  actives[12] = false;
  actives[13] = false;
}
if (actives[1] == false && actives[7] == false) {
  for (var i = 0; i < 14; i++) {
    actives[i] = false;
  }
}
}

function drawLine(a,b){
      ctx.beginPath();
      ctx.moveTo(a.offsetLeft+25,a.offsetTop+25);
      ctx.lineTo(b.offsetLeft+25,b.offsetTop+25);
      ctx.lineWidth = 1.5;
      ctx.strokeStyle = 'black';
      ctx.stroke();
  }

* {
    margin: 0px;
    padding: 0px;
  }

  button {
    position: absolute;
    border-radius: 50%;
  }

<!DOCTYPE html>
<meta name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="style.css">

<canvas id='mycanvas' width="500" height="500"></canvas>
<button id="b1" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 20px;">1</button>
<button id="b2" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 90px;">2</button>
<button id="b3" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 160px;">3</button>
<button id="b4" onclick="toogle(event)" style="width: 50px; height: 50px; top: 20px; left: 230px;">4</button>
<button id="b5" onclick="toogle(event)" style="width: 50px; height: 50px; top: 90px; left: 90px;">5</button>
<button id="b6" onclick="toogle(event)" style="width: 50px; height: 50px; top: 90px; left: 230px;">6</button>
<button id="b7" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 20px;">7</button>
<button id="b8" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 90px;">8</button>
<button id="b9" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 160px;">9</button>
<button id="b10" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 230px;">10</button>
<button id="b11" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 300px;">11</button>
<button id="b12" onclick="toogle(event)" style="width: 50px; height: 50px; top: 160px; left: 370px;">12</button>
<button id="b13" onclick="toogle(event)" style="width: 50px; height: 50px; top: 230px; left: 300px;">13</button>


问:
Throwing error does not show in response apollo
Ok so basically Im throwing a std error as such throw new Error('test') and have tried throwing this with ApolloError & GraphQLError. I have even tried returning new error with nothing in the response. Also this stops my server which I do not want.

when throwing the error the error is in only the console (server side) and the response returns 200 with something like this

sent (all vars are sent)

```<code>mutation Cprofile($input: ProfileInput) {
  cprofile(input: $input) {
    bg

  }
}
</code>```

response

```<code>{
  "data": {
    "stackoverflow": null
  }
}
</code>```

running apollo server like so

```<code>const server = new ApolloServer({
    typeDefs,
    resolvers,
    context: createContext
});
</code>```

please note ive tried format error

package.json

```<code>"apollo-server-core": "^3.10.3",
"apollo-server-express": "^3.10.3",
</code>```

Is there any way show error in response in apollo with typescript thanks

Body:
Ok so basically Im throwing a std error as such throw new Error('test') and have tried throwing this with ApolloError & GraphQLError. I have even tried returning new error with nothing in the response. Also this stops my server which I do not want.

when throwing the error the error is in only the console (server side) and the response returns 200 with something like this

sent (all vars are sent)

mutation Cprofile($input: ProfileInput) {
  cprofile(input: $input) {
    bg

  }
}

response

{
  "data": {
    "stackoverflow": null
  }
}

running apollo server like so

const server = new ApolloServer({
    typeDefs,
    resolvers,
    context: createContext
});

please note ive tried format error

package.json

"apollo-server-core": "^3.10.3",
"apollo-server-express": "^3.10.3",

Is there any way show error in response in apollo with typescript thanks