问:
Creating graph from .bin file
The following google drive link contains two sample data files (with .bin file extension) recorded from two channels of a vibration sensor and data is stored in binary format. The two file names given below :

DAS-Rio_Conveyor_Test-CH1-Rec6455-bin412-bin3750-F1.bin

DAS-Rio_Conveyor_Test-CH2-Rec6455-bin410-bin3800-F1.bin
It is required to read the .bin files & plot following graphs using Python
•   Minimum to maximum difference (peak to peak plot)
•   FFT for a specific position and time

Data files can be downloaded from here : https://drive.google.com/drive/folders/1V4Y6_luHhmg6gbPT5P7sf9LEmejcK_Xd?usp=sharing

Your program/solution should be able to :

get user input to specify the required variables for the plot

check whether the user input is within acceptable format/range

Demonstrate basic error handling techniques

```<code># Import the necessary libraries
import struct

# Open the .bin file in binary mode
with open('file.bin', 'rb') as f:
  # Read the data from the file using the `struct` module
  data = struct.unpack('iif', f.read())

# Create an empty graph
graph = {}

# Iterate over the data and add each element to the graph
for node_data in data:
  # Add the node to the graph
  graph[node_data[0]] = {'value': node_data[1], 'edges': []}

  # Add the edges to the node
  for edge in node_data[2]:
    graph[node_data[0]]['edges'].append(edge)

# Print the graph to verify that it has been created correctly
print(graph)

</code>```

Title: Creating graph from .bin file

Body:
The following google drive link contains two sample data files (with .bin file extension) recorded from two channels of a vibration sensor and data is stored in binary format. The two file names given below :

DAS-Rio_Conveyor_Test-CH1-Rec6455-bin412-bin3750-F1.bin

DAS-Rio_Conveyor_Test-CH2-Rec6455-bin410-bin3800-F1.bin
It is required to read the .bin files & plot following graphs using Python
•   Minimum to maximum difference (peak to peak plot)
•   FFT for a specific position and time

Data files can be downloaded from here : https://drive.google.com/drive/folders/1V4Y6_luHhmg6gbPT5P7sf9LEmejcK_Xd?usp=sharing

Your program/solution should be able to :

get user input to specify the required variables for the plot

check whether the user input is within acceptable format/range

Demonstrate basic error handling techniques

# Import the necessary libraries
import struct

# Open the .bin file in binary mode
with open('file.bin', 'rb') as f:
  # Read the data from the file using the `struct` module
  data = struct.unpack('iif', f.read())

# Create an empty graph
graph = {}

# Iterate over the data and add each element to the graph
for node_data in data:
  # Add the node to the graph
  graph[node_data[0]] = {'value': node_data[1], 'edges': []}

  # Add the edges to the node
  for edge in node_data[2]:
    graph[node_data[0]]['edges'].append(edge)

# Print the graph to verify that it has been created correctly
print(graph)


来源: stackexchange

问:
Why would calc(...%) not work in react.css?
Browser in console not seeing calc() function

I wanted to make a responsive website, without using px. But it is not working. Do I need to install a certain library?

ContentLicense: CC BY-SA 4.0


问:
import win32crypt: ImportError: DLL load failed: The specified module could not be found
when I run my python script, I get this error:

```<code>import win32crypt:
ImportError: DLL load failed: The specified module could not be found.
</code>```

I'm on Windows 10 and I am using Python 2.7 because the project I am trying to run was made in python 2.7

I tried running the script and got this error.

I tried all the solutions in this thread too: Can't import win32crypt python module

except pip install pypiwin32: which returns this error:

```<code>  Using cached pypiwin32-223.tar.gz (622 bytes)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\matma\\appdata\\local\\temp\\pip-install-f4ecmx\\pypiwin32\\setup.py'"'"'; __file__='"'"'c:\\users\\matma\\appdata\\local\\temp\\pip-install-f4ecmx\\pypiwin32\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\matma\appdata\local\temp\pip-pip-egg-info-tsajuh'
         cwd: c:\users\matma\appdata\local\temp\pip-install-f4ecmx\pypiwin32\
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 21, in <module>
        import setuptools.version
      File "C:\Python27\lib\site-packages\setuptools\version.py", line 1, in <module>
        import pkg_resources
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1380
        raise SyntaxError(e) from e
                                ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
</code>```

Body:
when I run my python script, I get this error:

import win32crypt:
ImportError: DLL load failed: The specified module could not be found.

I'm on Windows 10 and I am using Python 2.7 because the project I am trying to run was made in python 2.7

I tried running the script and got this error.

I tried all the solutions in this thread too: Can't import win32crypt python module

except pip install pypiwin32: which returns this error:

  Using cached pypiwin32-223.tar.gz (622 bytes)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\matma\\appdata\\local\\temp\\pip-install-f4ecmx\\pypiwin32\\setup.py'"'"'; __file__='"'"'c:\\users\\matma\\appdata\\local\\temp\\pip-install-f4ecmx\\pypiwin32\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\matma\appdata\local\temp\pip-pip-egg-info-tsajuh'
         cwd: c:\users\matma\appdata\local\temp\pip-install-f4ecmx\pypiwin32\
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Python27\lib\site-packages\setuptools\__init__.py", line 21, in <module>
        import setuptools.version
      File "C:\Python27\lib\site-packages\setuptools\version.py", line 1, in <module>
        import pkg_resources
      File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 1380
        raise SyntaxError(e) from e
                                ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


问:
How to startapp from inside docker-compose
I have a problem in the steps of testdriven.io The definitive guide to Django Celery, when i want to start a new tdd app if i execute these commands
`

```<code>$ docker-compose exec web bash

(container)$ ./manage.py startapp tdd
</code>```

`
it creates an app that is read only and pycharm cant change read only status. Some solutions say that it is because i created the app from root user but i cannot understand how to solve it. Here are the Dockerfile and the Docker-compose.

```<code>
</code>```
```<code>version: '3.3'

services:
  web:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_web
    # '/start' is the shell script used to run the service
    command: /start
    # this volume is used to map the files and folders on the host to the container
    # so if we change code on the host, code in the docker container will also be changed
    volumes:
      - .:/app
    ports:
      - 8010:8000
    # env_file is used to manage the env variables of our project
    env_file:
      - ./.env/.dev-sample
    depends_on:
      - redis
      - db
  db:
    image: postgres:14-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_DB=hello_django
      - POSTGRES_USER=hello_django
      - POSTGRES_PASSWORD=hello_django

  redis:
    image: redis:7-alpine

  celery_worker:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_celery_worker
    command: /start-celeryworker
    volumes:
      - .:/app
    env_file:
      - ./.env/.dev-sample
    depends_on:
      - redis
      - db

  celery_beat:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_celery_beat
    command: /start-celerybeat
    volumes:
      - .:/app
    env_file:
      - ./.env/.dev-sample
    depends_on:
      - redis
      - db

  flower:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_celery_flower
    command: /start-flower
    volumes:
      - .:/app
    env_file:
      - ./.env/.dev-sample
    ports:
      - 5557:5555
    depends_on:
      - redis
      - db

volumes:
  postgres_data:
</code>```
```<code>
</code>```

And the Dockerfile
`

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

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1

RUN apt-get update \
  # dependencies for building Python packages
  && apt-get install -y build-essential \
  # psycopg2 dependencies
  && apt-get install -y libpq-dev \
  # Translations dependencies
  && apt-get install -y gettext \
  # Additional dependencies
  && apt-get install -y procps \
  # cleaning up unused files
  && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
  && rm -rf /var/lib/apt/lists/*

# Requirements are installed here to ensure they will be cached.
COPY ./requirements.txt /requirements.txt
RUN pip install -r /requirements.txt

COPY ./compose/local/django/entrypoint /entrypoint
RUN sed -i 's/\r$//g' /entrypoint
RUN chmod +x /entrypoint

COPY ./compose/local/django/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start

COPY ./compose/local/django/celery/worker/start /start-celeryworker
RUN sed -i 's/\r$//g' /start-celeryworker
RUN chmod +x /start-celeryworker

COPY ./compose/local/django/celery/beat/start /start-celerybeat
RUN sed -i 's/\r$//g' /start-celerybeat
RUN chmod +x /start-celerybeat

COPY ./compose/local/django/celery/flower/start /start-flower
RUN sed -i 's/\r$//g' /start-flower
RUN chmod +x /start-flower

WORKDIR /app

ENTRYPOINT ["/entrypoint"]

</code>```

`

I tried creating a user in the dockerfile using this as a base but i was unsuccessful https://github.com/testdrivenio/django-on-docker/issues/10

Body:
I have a problem in the steps of testdriven.io The definitive guide to Django Celery, when i want to start a new tdd app if i execute these commands
`

$ docker-compose exec web bash

(container)$ ./manage.py startapp tdd

`
it creates an app that is read only and pycharm cant change read only status. Some solutions say that it is because i created the app from root user but i cannot understand how to solve it. Here are the Dockerfile and the Docker-compose.

version: '3.3'

services:
  web:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_web
    # '/start' is the shell script used to run the service
    command: /start
    # this volume is used to map the files and folders on the host to the container
    # so if we change code on the host, code in the docker container will also be changed
    volumes:
      - .:/app
    ports:
      - 8010:8000
    # env_file is used to manage the env variables of our project
    env_file:
      - ./.env/.dev-sample
    depends_on:
      - redis
      - db
  db:
    image: postgres:14-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_DB=hello_django
      - POSTGRES_USER=hello_django
      - POSTGRES_PASSWORD=hello_django

  redis:
    image: redis:7-alpine

  celery_worker:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_celery_worker
    command: /start-celeryworker
    volumes:
      - .:/app
    env_file:
      - ./.env/.dev-sample
    depends_on:
      - redis
      - db

  celery_beat:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_celery_beat
    command: /start-celerybeat
    volumes:
      - .:/app
    env_file:
      - ./.env/.dev-sample
    depends_on:
      - redis
      - db

  flower:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: testdriven_celery_flower
    command: /start-flower
    volumes:
      - .:/app
    env_file:
      - ./.env/.dev-sample
    ports:
      - 5557:5555
    depends_on:
      - redis
      - db

volumes:
  postgres_data:

And the Dockerfile
`

FROM python:3.10-slim-buster

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1

RUN apt-get update \
  # dependencies for building Python packages
  && apt-get install -y build-essential \
  # psycopg2 dependencies
  && apt-get install -y libpq-dev \
  # Translations dependencies
  && apt-get install -y gettext \
  # Additional dependencies
  && apt-get install -y procps \
  # cleaning up unused files
  && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
  && rm -rf /var/lib/apt/lists/*

# Requirements are installed here to ensure they will be cached.
COPY ./requirements.txt /requirements.txt
RUN pip install -r /requirements.txt

COPY ./compose/local/django/entrypoint /entrypoint
RUN sed -i 's/\r$//g' /entrypoint
RUN chmod +x /entrypoint

COPY ./compose/local/django/start /start
RUN sed -i 's/\r$//g' /start
RUN chmod +x /start

COPY ./compose/local/django/celery/worker/start /start-celeryworker
RUN sed -i 's/\r$//g' /start-celeryworker
RUN chmod +x /start-celeryworker

COPY ./compose/local/django/celery/beat/start /start-celerybeat
RUN sed -i 's/\r$//g' /start-celerybeat
RUN chmod +x /start-celerybeat

COPY ./compose/local/django/celery/flower/start /start-flower
RUN sed -i 's/\r$//g' /start-flower
RUN chmod +x /start-flower

WORKDIR /app

ENTRYPOINT ["/entrypoint"]

`

I tried creating a user in the dockerfile using this as a base but i was unsuccessful https://github.com/testdrivenio/django-on-docker/issues/10


问:
How to solve Python error: usb descriptors
As the title says I'm receiving an error when importing a python script.When importing script I would normally import the script then run it but it does not appear to run. I assume all my path and libraries are up to date but I could be wrong. Any suggestion would be helpfulWhen attempting to run the script

I've tried updated chrome drivers, USB drivers, reinstalling python/anaconda, setting up environment variables


问:
TLS Callbacks linker settings
Hello I wanted to try out TLS Callbacks from this example. It's from YT and autor runs this on Windows just like me. I tried to run this code in 2 IDEs Visual Studio and Code Blocks and both of them return an error about this line:

#pragma comment (linker, "/INCLUDE:__tls_used")

VS2022: undefined external symbol __tls_used
Code Blocks: No such file or directory

This error also disappear in VS2022 wehn I use  _tls_used instead of __tls_used, but it still doesn't works as it should. Is there any other linker setting that I am supposed to use for this code to make it working?

Title: TLS Callbacks linker settings


问:
connection in java application using jdbc and mysql
How to connect java based android application in android studio to MySQL with JDBC with a small example?

Tried writing @superLint function but got more errors


问:
Consistent error message while running grouping analysis in 'plspm' package
I am looking for some help in resolving an error using the partial least squares path modeling package ('plspm').

I can get results running a basic PLS-PM analysis but run into issues when using the grouping function, receiving the error message:

Error in if (w_dif < specs$tol || iter == specs$maxiter) break : missing value where TRUE/FALSE needed

I have no missing values and all variables have the proper classification. Elsewhere I read that there is a problem with processing observations with the exact same values across all variables, I have deleted those and still face this issue. I seem to be facing the issue only when I run the groups using the "bootstrap" method as well.

```<code>farmwood = read.csv("farmwood_groups(distance).csv", header = TRUE) %>%

slice(-c(119:123))

Control = c(0,0,0,0,0,0)
Normative = c(0,0,0,0,0,0)
B_beliefs = c(0,0,0,0,0,0)
P_control = c(1,0,0,0,0,0)
S_norm = c(0,1,0,0,0,0)
Behavior = c(0,0,1,1,1,0)

farmwood_path = rbind(Control, Normative, B_beliefs, P_control, S_norm, Behavior)

colnames(farmwood_path) = rownames(farmwood_path)

    farmwood_blocks = list(14:18,20:23,8:13,24:27,19,4:7)
farmwood_modes = rep("A", 6)
farmwood_pls = plspm(farmwood, farmwood_path, farmwood_blocks, modes = farmwood_modes)
ames(farmwood)[names(farmwood) == "QB3"] <- "Distance"

farmwood$Distance <- as.factor(farmwood$Distance)
distance_boot = plspm.groups(farmwood_pls, farmwood$Distance, method = "bootstrap")
distance_perm = plspm.groups(farmwood_pls, farmwood$Distance, method = "permutation")
</code>```

The data is contained here:

https://www.dropbox.com/s/8vewuupywpi1jkt/farmwood_groups%28distance%29.csv?dl=0

Any help would be appreciated. Thank you in advance

Body:
I am looking for some help in resolving an error using the partial least squares path modeling package ('plspm').

I can get results running a basic PLS-PM analysis but run into issues when using the grouping function, receiving the error message:

Error in if (w_dif < specs$tol || iter == specs$maxiter) break : missing value where TRUE/FALSE needed

I have no missing values and all variables have the proper classification. Elsewhere I read that there is a problem with processing observations with the exact same values across all variables, I have deleted those and still face this issue. I seem to be facing the issue only when I run the groups using the "bootstrap" method as well.

farmwood = read.csv("farmwood_groups(distance).csv", header = TRUE) %>%

slice(-c(119:123))

Control = c(0,0,0,0,0,0)
Normative = c(0,0,0,0,0,0)
B_beliefs = c(0,0,0,0,0,0)
P_control = c(1,0,0,0,0,0)
S_norm = c(0,1,0,0,0,0)
Behavior = c(0,0,1,1,1,0)

farmwood_path = rbind(Control, Normative, B_beliefs, P_control, S_norm, Behavior)

colnames(farmwood_path) = rownames(farmwood_path)

    farmwood_blocks = list(14:18,20:23,8:13,24:27,19,4:7)
farmwood_modes = rep("A", 6)
farmwood_pls = plspm(farmwood, farmwood_path, farmwood_blocks, modes = farmwood_modes)
ames(farmwood)[names(farmwood) == "QB3"] <- "Distance"

farmwood$Distance <- as.factor(farmwood$Distance)
distance_boot = plspm.groups(farmwood_pls, farmwood$Distance, method = "bootstrap")
distance_perm = plspm.groups(farmwood_pls, farmwood$Distance, method = "permutation")

The data is contained here:

https://www.dropbox.com/s/8vewuupywpi1jkt/farmwood_groups%28distance%29.csv?dl=0

Any help would be appreciated. Thank you in advance


问:
global declaration of NSTextField array
I want to declare a global array of NSTextFields, but "Class ViewController has no initializers." Yes, global, but static.

```<code>class ViewController: NSViewController {

    @IBOutlet weak var TextField01: NSTextField!
    @IBOutlet weak var TextField02: NSTextField!
    @IBOutlet weak var TextField03: NSTextField!

    var fieldArray: [NSTextField]

    override func viewDidLoad() {
        super.viewDidLoad()

        fieldArray = [TextField01, TextField02, TextField03]

    }

</code>```

I thought that the problem was the compiler not knowing about the main storyboard; that's why I didn't assign values to my fieldArray. It would appear that I need to declare (initialize?) fieldArray in some other way.

Title: global declaration of NSTextField array

Body:
I want to declare a global array of NSTextFields, but "Class ViewController has no initializers." Yes, global, but static.

class ViewController: NSViewController {

    @IBOutlet weak var TextField01: NSTextField!
    @IBOutlet weak var TextField02: NSTextField!
    @IBOutlet weak var TextField03: NSTextField!

    var fieldArray: [NSTextField]

    override func viewDidLoad() {
        super.viewDidLoad()

        fieldArray = [TextField01, TextField02, TextField03]

    }

I thought that the problem was the compiler not knowing about the main storyboard; that's why I didn't assign values to my fieldArray. It would appear that I need to declare (initialize?) fieldArray in some other way.


问:
How to save the captured image in streamlit
I developed one streamlit application in that I will crop the images and preview the same but I don't know how to save the cropped image

I need help to save the image which I cropped and I should able to see the image when I press previous and next.


问:
assign attributes to stars object to plot rasters in a grid with ggplot/facet_grid
I have individual rasters for the modeled distribution of different species in different seasons. I'd like to plot the rasters using ggplot and facet_grid(), with each column representing a different season, and each row representing a different species. I've tried creating a RasterStack from the individual rasters, converting the RasterStack to a stars object. However, I think I would need to assign attributes to each raster or the RasterStack or stars object (species name and season) to be able to use facet_grid()?

Here's a start with some simulated rasters:

```<code>library(NLMR)
library(stars)
library(tidyverse)
library(raster)

# simulating rasters for each season x species combination
spring_mall <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)
fall_mall <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)
spring_rndu <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)
fall_rndu <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)

# stack
r <- stack(c(spring_mall, fall_mall, spring_rndu, fall_rndu))

# rename
names(r) <- c('spring_mall', 'fall_mall', 'spring_rndu', 'fall_rndu')

# convert to stars object
r_stars <- r %>%
  st_as_stars()

# plot...I'd like the plot to look like this, except the panels are labeled
# just by season on top, just by species on side
ggplot() +
  geom_stars(data = r_stars) +
  facet_wrap(~band, ncol = 2)
</code>```

Body:
I have individual rasters for the modeled distribution of different species in different seasons. I'd like to plot the rasters using ggplot and facet_grid(), with each column representing a different season, and each row representing a different species. I've tried creating a RasterStack from the individual rasters, converting the RasterStack to a stars object. However, I think I would need to assign attributes to each raster or the RasterStack or stars object (species name and season) to be able to use facet_grid()?

Here's a start with some simulated rasters:

library(NLMR)
library(stars)
library(tidyverse)
library(raster)

# simulating rasters for each season x species combination
spring_mall <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)
fall_mall <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)
spring_rndu <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)
fall_rndu <- nlm_mpd(ncol = 50, nrow = 50, roughness = 0.6)

# stack
r <- stack(c(spring_mall, fall_mall, spring_rndu, fall_rndu))

# rename
names(r) <- c('spring_mall', 'fall_mall', 'spring_rndu', 'fall_rndu')

# convert to stars object
r_stars <- r %>%
  st_as_stars()

# plot...I'd like the plot to look like this, except the panels are labeled
# just by season on top, just by species on side
ggplot() +
  geom_stars(data = r_stars) +
  facet_wrap(~band, ncol = 2)


问:
Failed to download intellij-core from android/maven2 from dl.google.com (transfer closed with 19448035 bytes remaining to read)
While building an APK file using gradlew, I got this error:

```<code>[RUN_GRADLEW] > Task :react-native-community_datetimepicker:extractReleaseAnnotations FAILED
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
[RUN_GRADLEW] 45 actionable tasks: 45 executed
[RUN_GRADLEW] Execution failed for task ':react-native-community_datetimepicker:extractReleaseAnnotations'.
[RUN_GRADLEW] > Could not resolve all files for configuration ':react-native-community_datetimepicker:detachedConfiguration2'.
[RUN_GRADLEW]    > Could not download intellij-core-30.1.1.jar (com.android.tools.external.com-intellij:intellij-core:30.1.1)
[RUN_GRADLEW]       >
[RUN_GRADLEW] Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.1/intellij-core-30.1.1.jar'.
[RUN_GRADLEW]          > Premature end of Content-Length delimited message body (expected: 19,697,471; received: 192,194)
</code>```

Trying with curl gave the same problem:

```<code>curl --no-progress-meter https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.1/intellij-core-30.1.1.jar -o /dev/null
</code>```

Output:

```<code>curl: (18) transfer closed with 19026883 bytes remaining to read
</code>```

How to fix this?

Body:
While building an APK file using gradlew, I got this error:

[RUN_GRADLEW] > Task :react-native-community_datetimepicker:extractReleaseAnnotations FAILED
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
[RUN_GRADLEW] 45 actionable tasks: 45 executed
[RUN_GRADLEW] Execution failed for task ':react-native-community_datetimepicker:extractReleaseAnnotations'.
[RUN_GRADLEW] > Could not resolve all files for configuration ':react-native-community_datetimepicker:detachedConfiguration2'.
[RUN_GRADLEW]    > Could not download intellij-core-30.1.1.jar (com.android.tools.external.com-intellij:intellij-core:30.1.1)
[RUN_GRADLEW]       >
[RUN_GRADLEW] Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.1/intellij-core-30.1.1.jar'.
[RUN_GRADLEW]          > Premature end of Content-Length delimited message body (expected: 19,697,471; received: 192,194)

Trying with curl gave the same problem:

curl --no-progress-meter https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.1/intellij-core-30.1.1.jar -o /dev/null

Output:

curl: (18) transfer closed with 19026883 bytes remaining to read

How to fix this?


问:
For Loop /D Not Working for Network Attached Drives
TLDR:  When I do the following For Loop in the CMD line, I get different results depending on what disk is Current.

```<code>for /d %i in (*) do @echo %i
</code>```

It works if I am on any directory in the C: drive.

However, on any of my network attached drives, any directory, it won't work - there is no information provided - just goes back to the CMD prompt.

Edit:
I originally incorrectly described this as USB attached drives - these are network attached drives (connected via USB to an old wifi router which is Ethernet wire connected to my computer).  They are mapped to specific drive letters, not defined by UNC path. I have updated the Subject Line and the Body

Longer Explanation:

I've been successfully using a simple Batch file I created well over a year ago that would take any files in the Current directory and 7zip them.

I would just double-click the BAT file within File Explorer to launch it.

Yesterday, it stopped working.

At first I thought it was just that the BAT file wasn't recognized, and followed this and associated links:

https://superuser.com/questions/53948/how-do-i-restore-bat-files-association-with-the-system-make-them-run-when-doub

I rebooted just in case that was needed for it to take effect.

That didn't fix the problem.

I copied the BAT contents (one line - adjusted for CMD line use) into the CMD line, and for the affected drives it would replicate/echo that line of code but the /D was just a /.

```<code>for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a -t7z -m0=LZMA2 -mx=9 -mfb=64 -md=64m -mmt16 "%%X.7z" "%%X\"
</code>```

However, when testing, I accidentally found that line worked perfectly on a C: drive directory!!  I then tested the BAT file for C: drive - worked perfectly too!

I've found several questions on StackOverflow that are close, but not quite what my problem is - these were the closest:

Batch Script - FOR /D loop with wildcard folder issue

Batch file for loop /D flag not appearing in command line

Why is the letter D from /D option of command FOR missing in the output?

User JosefZ seems to be onto the problem, but hasn't found a solution yet (several years now).

I narrowed it down to the following CMD line snippet to simplify testing the issue.

```<code>for /d %i in (*) do @echo %i
</code>```

Result is slightly different for the affected drives - it doesn't show anything, just goes to a CMD prompt.  C: is perfect.

BTW, I can run 7z directly on each individual file no matter the location, so that is not an issue.

Update:  I can move, copy, delete individual files and groups of files betwixt the networked drives and the C: drive.

I'm guessing that it comes down to the /D function - for some reason it fails on the attached drives, but not the C: system drive.

I'm hoping for some ideas, short of reinstalling Windows 10.

Well, I might create a Power Automate Desktop Flow instead, making individual call to 7z for each file in a directory. A bit more of a pain to run though.

Still, I have no idea the cause nor a way out.  Thanks in advance for your help.

Body:
TLDR:  When I do the following For Loop in the CMD line, I get different results depending on what disk is Current.

for /d %i in (*) do @echo %i

It works if I am on any directory in the C: drive.

However, on any of my network attached drives, any directory, it won't work - there is no information provided - just goes back to the CMD prompt.

Edit:
I originally incorrectly described this as USB attached drives - these are network attached drives (connected via USB to an old wifi router which is Ethernet wire connected to my computer).  They are mapped to specific drive letters, not defined by UNC path. I have updated the Subject Line and the Body

Longer Explanation:

I've been successfully using a simple Batch file I created well over a year ago that would take any files in the Current directory and 7zip them.

I would just double-click the BAT file within File Explorer to launch it.

Yesterday, it stopped working.

At first I thought it was just that the BAT file wasn't recognized, and followed this and associated links:

https://superuser.com/questions/53948/how-do-i-restore-bat-files-association-with-the-system-make-them-run-when-doub

I rebooted just in case that was needed for it to take effect.

That didn't fix the problem.

I copied the BAT contents (one line - adjusted for CMD line use) into the CMD line, and for the affected drives it would replicate/echo that line of code but the /D was just a /.

for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a -t7z -m0=LZMA2 -mx=9 -mfb=64 -md=64m -mmt16 "%%X.7z" "%%X\"

However, when testing, I accidentally found that line worked perfectly on a C: drive directory!!  I then tested the BAT file for C: drive - worked perfectly too!

I've found several questions on StackOverflow that are close, but not quite what my problem is - these were the closest:

Batch Script - FOR /D loop with wildcard folder issue

Batch file for loop /D flag not appearing in command line

Why is the letter D from /D option of command FOR missing in the output?

User JosefZ seems to be onto the problem, but hasn't found a solution yet (several years now).

I narrowed it down to the following CMD line snippet to simplify testing the issue.

for /d %i in (*) do @echo %i

Result is slightly different for the affected drives - it doesn't show anything, just goes to a CMD prompt.  C: is perfect.

BTW, I can run 7z directly on each individual file no matter the location, so that is not an issue.

Update:  I can move, copy, delete individual files and groups of files betwixt the networked drives and the C: drive.

I'm guessing that it comes down to the /D function - for some reason it fails on the attached drives, but not the C: system drive.

I'm hoping for some ideas, short of reinstalling Windows 10.

Well, I might create a Power Automate Desktop Flow instead, making individual call to 7z for each file in a directory. A bit more of a pain to run though.

Still, I have no idea the cause nor a way out.  Thanks in advance for your help.


问:
How to use multiples filters in SecurityConfig on Spring Boot?
I have an application that validates an authentication token to access your endpoints. It is important to note that I do not have a user's logged in. This validation is made as follows:

I get the token and I call an REST API that tells me if that token is valid or not (this validation is made through a filter through which all the requests I receive pass).

But now I have to do another validation besides that. I need to decrypt the token to pick up a set of roles and see if for certain endpoints the rule validates. Initially I thought about using @Secured but I noticed that without a log in he cannot know where the roles come from that he should validate. So I thought I'd create a filter that would only be used on a few endpoints and validate the permissive role. Something like this:

http
    .authorizeRequests(r ->
        r
             .antMatchers("/isAlive**").permitAll()
             .antMatchers("/users").permitAll()
             .and()
        .addFilterBefore(new RoleFilter(),  UsernamePasswordAuthenticationFilter.class)
             .antMatchers("/cars").permitAll()
             .and()
        .addFilterBefore(new RoleFilter(),  UsernamePasswordAuthenticationFilter.class)
             .anyRequest().permitAll()
             .and()
        .addFilterBefore(new AuthorizationFilter(), UsernamePasswordAuthenticationFilter.class))
    .sessionManagement()
        .sessionCreationPolicy(SessionCreationPolicy.STATELESS);
```

As you can see the AuthorizationFilter is the filter that must be done by all endpoints except /isAlive. It validates whether the token is valid.

And RoleFilter should be used only on some endpoints to validate whether that token has the specific role that I need. But that doesn't work. It does not accept this structure with two filters. Any solution?

Body:
I have an application that validates an authentication token to access your endpoints. It is important to note that I do not have a user's logged in. This validation is made as follows:

I get the token and I call an REST API that tells me if that token is valid or not (this validation is made through a filter through which all the requests I receive pass).

But now I have to do another validation besides that. I need to decrypt the token to pick up a set of roles and see if for certain endpoints the rule validates. Initially I thought about using @Secured but I noticed that without a log in he cannot know where the roles come from that he should validate. So I thought I'd create a filter that would only be used on a few endpoints and validate the permissive role. Something like this:

http
    .authorizeRequests(r ->
        r
             .antMatchers("/isAlive**").permitAll()
             .antMatchers("/users").permitAll()
             .and()
        .addFilterBefore(new RoleFilter(),  UsernamePasswordAuthenticationFilter.class)
             .antMatchers("/cars").permitAll()
             .and()
        .addFilterBefore(new RoleFilter(),  UsernamePasswordAuthenticationFilter.class)
             .anyRequest().permitAll()
             .and()
        .addFilterBefore(new AuthorizationFilter(), UsernamePasswordAuthenticationFilter.class))
    .sessionManagement()
        .sessionCreationPolicy(SessionCreationPolicy.STATELESS);

As you can see the AuthorizationFilter is the filter that must be done by all endpoints except /isAlive. It validates whether the token is valid.

And RoleFilter should be used only on some endpoints to validate whether that token has the specific role that I need. But that doesn't work. It does not accept this structure with two filters. Any solution?


问:
Try to configurate redux persist, but local stotage doesnt update
I have a store and a reducer, and I want to use redux persist to store user data in the local storage. Local storage shows data but doesn't update, what am I doing wrong? Here is the store and reducer code, the data remains the same as in the initial state.

```<code>store.ts

import { combineReducers, configureStore } from "@reduxjs/toolkit";
import {
  FLUSH,
  PAUSE,
  PERSIST,
  persistReducer,
  persistStore,
  PURGE,
  REGISTER,
  REHYDRATE,
} from "redux-persist";
import storage from "redux-persist/lib/storage";
import { authApi } from "./../api/AuthService";
import authReducer from "./reducers/AuthSlice";

const rootReducer = combineReducers({
  authReducer: authReducer,
  [authApi.reducerPath]: authApi.reducer,
});

const persistConfig = {
  key: "root",
  version: 1,
  storage: storage,
  blacklist: [authApi.reducerPath],
};

const persistedReducer = persistReducer(persistConfig, rootReducer);

export const setupStore = () => {
  return configureStore({
    reducer: persistedReducer,
    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware({
        serializableCheck: {
          ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
        },
      }).concat(authApi.middleware),
  });
};

const store = setupStore();

export type RootState = ReturnType<typeof persistedReducer>;
export type AppStore = ReturnType<typeof setupStore>;
export type AppDispatch = AppStore["dispatch"];

export const persistor = persistStore(store);
</code>```
```<code>authSlice.ts

import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { UserResponse } from "../../api/AuthService";
import { RootState } from "./../store";

interface AuthState {
  userName: string | null;
  roles: string[] | null;
  token: string | null;
}

const initialState: AuthState = {
  userName: null,
  roles: null,
  token: null,
};

export const authSlice = createSlice({
  name: "auth",
  initialState: initialState,
  reducers: {
    setCredentials: (state: AuthState, action: PayloadAction<UserResponse>) => {
      state.userName = action.payload.userName;
      state.roles = action.payload.roles;
      state.token = action.payload.token;
    },
    logOut: (state, action) => {
      state.userName = null;
      state.roles = null;
      state.token = null;
    },
  },
});

export default authSlice.reducer;

export const selectUser = (state: RootState) => state.authReducer.userName;
export const selectRoles = (state: RootState) => state.authReducer.roles;
export const selectToken = (state: RootState) => state.authReducer.token;
</code>```

enter image description here

This data is displayed in local storage, but it is not updated.

Body:
I have a store and a reducer, and I want to use redux persist to store user data in the local storage. Local storage shows data but doesn't update, what am I doing wrong? Here is the store and reducer code, the data remains the same as in the initial state.

store.ts

import { combineReducers, configureStore } from "@reduxjs/toolkit";
import {
  FLUSH,
  PAUSE,
  PERSIST,
  persistReducer,
  persistStore,
  PURGE,
  REGISTER,
  REHYDRATE,
} from "redux-persist";
import storage from "redux-persist/lib/storage";
import { authApi } from "./../api/AuthService";
import authReducer from "./reducers/AuthSlice";

const rootReducer = combineReducers({
  authReducer: authReducer,
  [authApi.reducerPath]: authApi.reducer,
});

const persistConfig = {
  key: "root",
  version: 1,
  storage: storage,
  blacklist: [authApi.reducerPath],
};

const persistedReducer = persistReducer(persistConfig, rootReducer);

export const setupStore = () => {
  return configureStore({
    reducer: persistedReducer,
    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware({
        serializableCheck: {
          ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
        },
      }).concat(authApi.middleware),
  });
};

const store = setupStore();

export type RootState = ReturnType<typeof persistedReducer>;
export type AppStore = ReturnType<typeof setupStore>;
export type AppDispatch = AppStore["dispatch"];

export const persistor = persistStore(store);

authSlice.ts

import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { UserResponse } from "../../api/AuthService";
import { RootState } from "./../store";

interface AuthState {
  userName: string | null;
  roles: string[] | null;
  token: string | null;
}

const initialState: AuthState = {
  userName: null,
  roles: null,
  token: null,
};

export const authSlice = createSlice({
  name: "auth",
  initialState: initialState,
  reducers: {
    setCredentials: (state: AuthState, action: PayloadAction<UserResponse>) => {
      state.userName = action.payload.userName;
      state.roles = action.payload.roles;
      state.token = action.payload.token;
    },
    logOut: (state, action) => {
      state.userName = null;
      state.roles = null;
      state.token = null;
    },
  },
});

export default authSlice.reducer;

export const selectUser = (state: RootState) => state.authReducer.userName;
export const selectRoles = (state: RootState) => state.authReducer.roles;
export const selectToken = (state: RootState) => state.authReducer.token;

enter image description here

This data is displayed in local storage, but it is not updated.


问:
Running Python in R Studio
I'm trying to start using R studio as IDE for python, but I cannot even start doing so because miniconda installation fails to complete. As follows.</p>
```<code>reticulate::repl_python()
No non-system installation of Python could be found.
Would you like to download and install Miniconda?
Miniconda is an open source environment management system for Python.
See https://docs.conda.io/en/latest/miniconda.html for more details.

Would you like to install Miniconda? [Y/n]: import pandas as pd
Please answer yes or no:
* Installing Miniconda -- please wait a moment ...
* Downloading "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" ...
trying URL 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'
Content type 'application/octet-stream' length 55508040 bytes (52.9 MB)
downloaded 52.9 MB

Error: miniconda installation failed [exit code 2]
</code>```

Title: Running Python in R Studio

Body:
I'm trying to start using R studio as IDE for python, but I cannot even start doing so because miniconda installation fails to complete. As follows.

reticulate::repl_python()
No non-system installation of Python could be found.
Would you like to download and install Miniconda?
Miniconda is an open source environment management system for Python.
See https://docs.conda.io/en/latest/miniconda.html for more details.

Would you like to install Miniconda? [Y/n]: import pandas as pd
Please answer yes or no:
* Installing Miniconda -- please wait a moment ...
* Downloading "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" ...
trying URL 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'
Content type 'application/octet-stream' length 55508040 bytes (52.9 MB)
downloaded 52.9 MB

Error: miniconda installation failed [exit code 2]


问:
Prisma unique annotation
I'm with a problem where I can't create a 1:1 relationship in Prisma without the unique annotation.

Right now, my schema looks like this:

```<code>  model Transaction {
  id         Int      @id @default(autoincrement())
  type       Type?
  date       DateTime
  product    String
  value      Int
  seller     String
  typeTypeId Int      @unique
}

model Type {
  id          Int         @id @default(autoincrement())
  description String
  nature      String
  sign        String
  transaction Transaction @relation(fields: [typeId], references: [typeTypeId])
  typeId      Int  @unique
}
</code>```

The idea is that on the Type table, I'll have 4 fixed types (1, 2, 3, 4) and on the Transaction table I can have multiple records with the same type, but not two types on the same record, so:

On the Transaction table, a record with types 1, 2 would not be OK, but multiple records with the Type 1 is OK.

I'm not sure if there is something wrong with my modeling or if there is something with Prisma that I'm missing.

Thanks in advance.

Title: Prisma unique annotation

Body:
I'm with a problem where I can't create a 1:1 relationship in Prisma without the unique annotation.

Right now, my schema looks like this:

  model Transaction {
  id         Int      @id @default(autoincrement())
  type       Type?
  date       DateTime
  product    String
  value      Int
  seller     String
  typeTypeId Int      @unique
}

model Type {
  id          Int         @id @default(autoincrement())
  description String
  nature      String
  sign        String
  transaction Transaction @relation(fields: [typeId], references: [typeTypeId])
  typeId      Int  @unique
}

The idea is that on the Type table, I'll have 4 fixed types (1, 2, 3, 4) and on the Transaction table I can have multiple records with the same type, but not two types on the same record, so:

On the Transaction table, a record with types 1, 2 would not be OK, but multiple records with the Type 1 is OK.

I'm not sure if there is something wrong with my modeling or if there is something with Prisma that I'm missing.

Thanks in advance.


问:
MemoryError Precedes BrokenPipeError While Training CNN
Generally for running pip with no cache we use --no-cache-dir, like

pip install pytorch --no-cache-dir.

I downloaded a CNN model I want to use from github.
The first two lines of execution

```<code> python generate_dataset.py --is_train=True --use_phase=True --chip_size=100 --patch_size=94 --use_phase=True --dataset=soc
 python generate_dataset.py --is_train=False --use_phase=True --chip_size=128 --patch_size=128  --use_phase=True --dataset=soc
</code>```

executed succesfully. But while running

```<code>python train.py --config_name=config/AConvNet-SOC.json
</code>```

It is giving MemoryError.

The publisher of above repository is using 32GB RAM and 11 GB GPU. But I have 8 GB RAM and 8GB GPU.
Here is what I have done:

I thought of running it without cache. like,

```<code>python train.py --config_name=config/AConvNet-SOC.json --no-cache-dir
</code>```

But it is throwing below error

FATAL Flags parsing error: Unknown command line flag 'no-cache-dir' Pass --helpshort or --helpfull to see help on flags.

I think it is because no-cache-dir argument is not defined in it by using absl.flags. Does python supports using no chache directory implementation

I am able to solve it by decreasing the number of epochs and batch_size. But I want to run it for full epochs.

Using zeo_grad() of Pytorch makes the gradients zero for every minibatch, so that GPU won't run out of memory. But it is already used in the code I am running in _base.py. Is there anyway I can leverage more of this.

How to resolve this.

Body:
Generally for running pip with no cache we use --no-cache-dir, like

pip install pytorch --no-cache-dir.

I downloaded a CNN model I want to use from github.
The first two lines of execution

 python generate_dataset.py --is_train=True --use_phase=True --chip_size=100 --patch_size=94 --use_phase=True --dataset=soc
 python generate_dataset.py --is_train=False --use_phase=True --chip_size=128 --patch_size=128  --use_phase=True --dataset=soc

executed succesfully. But while running

python train.py --config_name=config/AConvNet-SOC.json

It is giving MemoryError.

The publisher of above repository is using 32GB RAM and 11 GB GPU. But I have 8 GB RAM and 8GB GPU.
Here is what I have done:

I thought of running it without cache. like,

python train.py --config_name=config/AConvNet-SOC.json --no-cache-dir

But it is throwing below error

FATAL Flags parsing error: Unknown command line flag 'no-cache-dir' Pass --helpshort or --helpfull to see help on flags.

I think it is because no-cache-dir argument is not defined in it by using absl.flags. Does python supports using no chache directory implementation

I am able to solve it by decreasing the number of epochs and batch_size. But I want to run it for full epochs.

Using zeo_grad() of Pytorch makes the gradients zero for every minibatch, so that GPU won't run out of memory. But it is already used in the code I am running in _base.py. Is there anyway I can leverage more of this.

How to resolve this.


问:
Trigger button accesing a custom url
I want to auto trigger button accesing/load to a custom url/page taking a parameter from that url/page

when the user is in domain home (homepage) and click an image href (link, button, doesn't matter) i need to be redirected and land on "domain/projects/#homes" and from there take the parameter "#homes" and autoload/autoclick/automatic trigger a button with that parameter from url.

The reason that i need this is because from homepage i have a banner with 4 photos representing the categories of projects, and the grid with filters is in the page domain/projects, so i want the user be able to click one categorie from homepage and be redirected to domain/projects and trigger a button in the grid with filters. This page is in Wordpress.

searching i have found that this can be done with jquery.

the "ul li" options/filters are selected when the class "active" is added to the "li" tag

The problems : from what i understand Wordpress have built in jquery so the "$" the simbols are replaced by "jQuery" or something like that, the other problem is that the filter and html is defined like this:

```<code><div class="et_pb_code_inner">
  <script>
    jQuery(document).ready(function() {
      if (window.location.search == "mharquitecto.cl/proyectos/#casas") {
        $("ul.simplefilter_55 li:nth-child(1)").addClass("active");
      }
      /*if (window.location.search == "?return") {
        p200table.button( 7 ).trigger();
      }*/
    });
  </script>
</div>undefined</div>undefined<div class="et_pb_module et_pb_fullwidth_code et_pb_fullwidth_code_1">
  <div class="et_pb_code_inner">
    <!-- CSS Part Start From Here-->
    <style>
      .portfolio-wraper {
        margin-bottom: 20px;
      }

      li#all {
        margin: 0;
      }

      .simplefilter li {
        margin-top: 5px;
      }

      .filtr-search {
        margin-top: 10px !important;
        width: 200px !important;
        margin-bottom: 20px;
      }

      #all-simplefilter {
        display: inline;
        padding-left: 0px !important;
      }

      #f-simplefilter-55 {
        display: inline;
        padding-left: 0px !important;
      }

      @keyframes .YouTubePopUp-Content {
        from {
          transform: translate3d(0, 100%, 0);
          visibility: visible;
        }

        to {
          transform: translate3d(0, 0, 0);
        }
      }

      .YouTubePopUp-Content {
        animation-name: .YouTubePopUp-Content;
      }

      .YouTubePopUp-Close {
        background: url(DOMAIN/wp-content/plugins/portfolio-filter-gallery//img/close-icon-white.png) no-repeat;
        background-size: 50px 50px;
        -webkit-background-size: 70px 50px;
        -moz-background-size: 70px 50px;
        -o-background-size: 70px 50px;
      }

      ul.simplefilter {
        margin-left: 0 !important;
      }

      .pfg_img_55 {
        width: 100% !important;
        height: 100% !important;
      }

      .filter_gallery_55>a {
        position: initial !important;
      }

      .thumbnail_55 {
        width: 100% !important;
        height: auto;
        margin-bottom: 0px !important;
      }

      .filtr-item {
        padding-right: 7px !important;
        padding-left: 7px !important;
        padding-top: 7px !important;
        padding-bottom: 7px !important;
      }

      .filtr-item img {
        transition: all .2s !important
      }

      .simplefilter_55 li {
        background-color: #ccc;
        color: ;
      }

      .simplefilter_55 li:hover {
        background-color:  !important;
      }

      .simplefilter_55 li.active {
        background-color:  !important;
      }
    </style>
    <div class="portfolio-wraper pfg-bootstrap" version="1.4.7">
      <div class="col-lg-12 col-md-12 col-xs-12 text-center">
        <ul id="all-simplefilter" class="filtr-control-55 simplefilter simplefilter_55">
          <li id="all" class="active filtr-controls-55" data-filter="all">Todos</li>
        </ul>
        <ul id="f-simplefilter-55" class="filtr-control-55 simplefilter simplefilter_55">
          <li data-filter="1" class="filtr-controls-55">Casas</li>
          <li data-filter="2" class="filtr-controls-55">Arquitecturas Comerciales</li>
          <li data-filter="3" class="filtr-controls-55">Quinchos</li>
          <li data-filter="4" class="filtr-controls-55">Remodelaciones</li>
        </ul>
      </div>
      <!-- Shuffle & Sort Controls -->
      <div class="row loading-wrapper text-center">
        <img decoding="async" src="DOMAIN/wp-content/plugins/portfolio-filter-gallery//img/loading-icon.gif" width="60">
      </div>
      <div class="filter_gallery_55 row filtr-container filters-div" style="opacity:0; display:none;">
        <a href="DOMAIN/project/proyecto-1/" target="_blank" title="casa 1" title="casa 1">
          <div data-category="1" data-sort="casa 1" class="animateonload filtr-item filtr_item_55 single_one col-lg-3 col-md-4 col-sm-6 col-12">
            <img decoding="async" class=" thumbnail_55 pfg-img pfg_img_55 img-responsive hvr-grow-shadow" src="DOMAIN/wp-content/uploads/2022/12/la-vivienda-de-formas-aerodinamicas-lleva-su-relacion-con-el-agua-a-otro-nivel-de-la-mano-del-arquitecto-frances-david-tajchman-43692def-1500x871_87fab854_1200x630-300x158.jpeg" alt="">
            <span class="item-desc item_desc_55">casa 1</span>
          </div>
        </a>
        <a href="DOMAIN/project/proyecto-1/DOMAIN/project/proyecto-2/" target="_blank" title="casa 2" title="casa 2">
          <div data-category="1" data-sort="casa 2" class="animateonload filtr-item filtr_item_55 single_one col-lg-3 col-md-4 col-sm-6 col-12">
            <img decoding="async" class=" thumbnail_55 pfg-img pfg_img_55 img-responsive hvr-grow-shadow" src="DOMAIN/wp-content/uploads/2022/12/4-PROYECTOS-DE-ARQUITECTURA-INNOVADORES1-1024x768-1-300x225.jpeg" alt="">
            <span class="item-desc item_desc_55">casa 2</span>
          </div>
        </a>
        <a href="DOMAIN/project/proyecto-3/" target="_blank" title="arq com 1" title="arq com 1">
          <div data-category="2" data-sort="arq com 1" class="animateonload filtr-item filtr_item_55 single_one col-lg-3 col-md-4 col-sm-6 col-12">
            <img decoding="async" class=" thumbnail_55 pfg-img pfg_img_55 img-responsive hvr-grow-shadow" src="DOMAIN/wp-content/uploads/2022/12/descarga-9-300x164.jpeg" alt="">
            <span class="item-desc item_desc_55">arq com 1</span>
          </div>
        </a>
        <a href="DOMAIN/project/proyecto-4/" target="_blank" title="arq com 2" title="arq com 2">
          <div data-category="2" data-sort="arq com 2" class="animateonload filtr-item filtr_item_55 single_one col-lg-3 col-md-4 col-sm-6 col-12">
            <img decoding="async" class=" thumbnail_55 pfg-img pfg_img_55 img-responsive hvr-grow-shadow" src="DOMAIN/wp-content/uploads/2022/12/hotel-OZADI_JOSE_CAMPOS_fad-arquitectura-2015-942x531-1-300x169.jpeg" alt="">
            <span class="item-desc item_desc_55">arq com 2</span>
          </div>
        </a>
        <a href="DOMAIN/project/proyecto-5/" target="_blank" title="quincho 1" title="quincho 1">
          <div data-category="3" data-sort="quincho 1" class="animateonload filtr-item filtr_item_55 single_one col-lg-3 col-md-4 col-sm-6 col-12">
            <img decoding="async" class=" thumbnail_55 pfg-img pfg_img_55 img-responsive hvr-grow-shadow" src="DOMAIN/wp-content/uploads/2022/12/776_3_HR_ZeitzMOCAA_HeatherwickStudio_Credit_Iwan_Baan_View_of_Zeitz_MOCAA_in_Silo_Square-300x200.jpeg" alt="">
            <span class="item-desc item_desc_55">quincho 1</span>
          </div>
        </a>
        <a href="DOMAIN/project/proyecto-6/" target="_blank" title="remodelacion 1" title="remodelacion 1">
          <div data-category="4" data-sort="remodelacion 1" class="animateonload filtr-item filtr_item_55 single_one col-lg-3 col-md-4 col-sm-6 col-12">
            <img decoding="async" class=" thumbnail_55 pfg-img pfg_img_55 img-responsive hvr-grow-shadow" src="DOMAIN/wp-content/uploads/2022/12/031-Los-100-Mejores-Proyectos-Arquitectonicos-del-Siglo-XXI-image79-300x200.jpeg" alt="">
            <span class="item-desc item_desc_55">remodelacion 1</span>
          </div>
        </a>
      </div>
    </div>
    <script>
      setTimeout(function() {
        jQuery(".thumbnail_55").each(function() {
          // console.log(jQuery(this).width() + "x" + jQuery(this).height())
          var h = jQuery(this).height();
          var w = jQuery(this).width();
          jQuery(this).height(h);
          jQuery(this).width(w);
          jQuery(this).resize();
        });
      }, 2500);
      jQuery(document).ready(function(jQuery) {
        jQuery('.filtr-item').addClass('animateonload');
        jQuery('#filter_gallery_55').show();
        jQuery('.loading-wrapper').hide();
        jQuery(".loader_img").hide();
        jQuery(".lg_load_more").show();
        jQuery(".filtr-container").css("opacity", 1);
        //Filterizd Default options
        options = {
          animationDuration: 0.5,
          callbacks: {
            onFilteringStart: function() {},
            onFilteringEnd: function() {},
            onShufflingStart: function() {},
            onShufflingEnd: function() {},
            onSortingStart: function() {},
            onSortingEnd: function() {}
          },
          controlsSelector: '.filtr-controls-55',
          filter: 'all',
          filterOutCss: {
            top: '0px',
            left: '0px',
            opacity: 0.001,
            transform: ''
          },
          filterInCss: {
            top: '0px',
            left: '0px',
            opacity: 1,
            transform: ''
          },
          layout: 'sameWidth',
          selector: '.filtr-item',
          setupControls: false
        }
        var filterizd = jQuery('.filter_gallery_55').filterizr(options);
        //filterizd.filterizr('sort', 'domIndex', 'desc');
        jQuery('.filter_gallery_55').imagesLoaded(function() {
          // images have already loaded, instantiate Filterizr
          jQuery('.filter_gallery_55').filterizr(options);
        });
        //bootstrap-lightbox-js
        // delegate calls to data-toggle="lightbox"
        jQuery(document).delegate('*[data-toggle="lightbox"]:not([data-gallery="navigateTo"])', 'click', function(event) {
          event.preventDefault();
          return jQuery(this).ekkoLightbox({
            onShown: function() {
              /* if (window.console) {
                return console.log('Checking our the events huh?');
              } */
            },
            onNavigate: function(direction, itemIndex) {
              if (window.console) {
                return console.log('Navigating ' + direction + '. Current item: ' + itemIndex);
              }
            }
          });
        });
        jQuery('.filtr-control-55 [data-filter]').click(function() {
          //jQuery('.swiper-55').swipebox('swipebox-destroy');
          var targetFilter = jQuery(this).data('filter');
          var lighbox_class_name = "pfg-lightbox-" + targetFilter;
          jQuery('.pfg-lightbox-' + targetFilter).attr('data-lightbox', lighbox_class_name); // add data filter for parent filters
        });
        //Programatically call
        jQuery('#open-image').click(function(e) {
          e.preventDefault();
          jQuery(this).ekkoLightbox();
        });
        jQuery('#open-youtube').click(function(e) {
          e.preventDefault();
          jQuery(this).ekkoLightbox();
        });
        // navigateTo
        jQuery(document).delegate('*[data-gallery="navigateTo"]', 'click', function(event) {
          event.preventDefault();
          var lb;
          return jQuery(this).ekkoLightbox({
            onShown: function() {
              lb = this;
              jQuery(lb.modal_content).on('click', '.modal-footer a', function(e) {
                e.preventDefault();
                lb.navigateTo(2);
              });
            }
          });
        });
        // video player
        jQuery(function() {
          jQuery("a.video-box-55").YouTubePopUp({
            autoplay: 0
          }); // Disable autoplay
        });
      });
    </script>
  </div>
</div>
</code>```

FIX UPDATE I've found a solution with php and with divi filterable portfolio. Here is :

```<code>

$feature = new DBC_Default_Portfolio_Tab('cat1');
$feature->init();
class DBC_Default_Portfolio_Tab {
    private $slug;
    public function __construct($category_slug) {
        $this->slug = $category_slug;
    }
    public function init() {
        add_filter('et_pb_filterable_portfolio_shortcode_output', array($this, 'dbc_set_default_portfolio_tab'));
        add_action('wp_head', array($this, 'dbc_default_portfolio_tab_css'));
    }
    function dbc_set_default_portfolio_tab($output) {
        $output = str_replace(
            'class="active" data-category-slug="all"',
            'data-category-slug="all"',
            $output
        );
        $output = str_replace(
            'data-category-slug="'.esc_attr($this->slug).'"',
            'data-category-slug="'.esc_attr($this->slug).'" class="active"',
            $output
        );
        return $output;
    }

    function dbc_default_portfolio_tab_css() {
        ?>
        <style>
            .et_pb_portfolio_filter_all {
                display: none !important;
            }
            .et_pb_portfolio_item:not(.project_category-<?php esc_html_e($this->slug); ?>) {
                display: none;
            }
        </style>
        <?php
    }
}
</code>```

Title: Trigger button accesing a custom url

Body:
I want to auto trigger button accesing/load to a custom url/page taking a parameter from that url/page

when the user is in domain home (homepage) and click an image href (link, button, doesn't matter) i need to be redirected and land on "domain/projects/#homes" and from there take the parameter "#homes" and autoload/autoclick/automatic trigger a button with that parameter from url.

The reason that i need this is because from homepage i have a banner with 4 photos representing the categories of projects, and the grid with filters is in the page domain/projects, so i want the user be able to click one categorie from homepage and be redirected to domain/projects and trigger a button in the grid with filters. This page is in Wordpress.

searching i have found that this can be done with jquery.

the "ul li" options/filters are selected when the class "active" is added to the "li" tag

The problems : from what i understand Wordpress have built in jquery so the "$" the simbols are replaced by "jQuery" or something like that, the other problem is that the filter and html is defined like this:

undefined
undefined

Todos

Casas

Arquitecturas Comerciales

Quinchos

Remodelaciones

            casa 1

            casa 2

            arq com 1

            arq com 2

            quincho 1

            remodelacion 1

FIX UPDATE I've found a solution with php and with divi filterable portfolio. Here is :

$feature = new DBC_Default_Portfolio_Tab('cat1');
$feature->init();
class DBC_Default_Portfolio_Tab {
    private $slug;
    public function __construct($category_slug) {
        $this->slug = $category_slug;
    }
    public function init() {
        add_filter('et_pb_filterable_portfolio_shortcode_output', array($this, 'dbc_set_default_portfolio_tab'));
        add_action('wp_head', array($this, 'dbc_default_portfolio_tab_css'));
    }
    function dbc_set_default_portfolio_tab($output) {
        $output = str_replace(
            'class="active" data-category-slug="all"',
            'data-category-slug="all"',
            $output
        );
        $output = str_replace(
            'data-category-slug="'.esc_attr($this->slug).'"',
            'data-category-slug="'.esc_attr($this->slug).'" class="active"',
            $output
        );
        return $output;
    }

    function dbc_default_portfolio_tab_css() {
        ?>

        <?php
    }
}


问:
React Micro App Shows SetExtraStack Frame Error
I just started working on this React/Typescript Micro App and I noticed that if I don't add a key on a node while iterating over it with map, it throws this error. I know you usually would see a warning but not an app breaking error like this. Anyone knows why?


问:
Google Drive API v3 - error sending files in chunks
I was making an application to send backup files to the Drive, however, when I try to send the files in chunks, I am getting a 400 error in the first request.

```<code>procedure TMainForm.btnTesteClick(Sender: TObject);
const
  cURL = 'URL from requset';
  cFilePath = 'path of File';
var
  zIdHTTP: TIdHTTP;
  zParams: TIdMultiPartFormDataStream;
  zIOHandler: TIdSSLIOHandlerSocketOpenSSL;
  zMemFile: TFileStream;
begin
  zIdHTTP:= TIdHTTP.Create();
  zParams:=  TIdMultiPartFormDataStream.Create();
  zIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create();
  try
    zIOHandler.SSLOptions.SSLVersions := [sslvTLSv1_2];
    zIOHandler.SSLOptions.Mode := sslmUnassigned;
    zIOHandler.SSLOptions.VerifyMode:= [];
    zIOHandler.SSLOptions.VerifyDepth:=0;
    zIdHTTP.IOHandler:= zIOHandler;
    zIdHTTP.HandleRedirects:= True;

    try
      zMemFile:= TFileStream.Create(cFilePath, fmOpenReadWrite);

      zIdHTTP.Request.CustomHeaders.AddValue('Content-Length', '8388608');
      zIdHTTP.Request.CustomHeaders.AddValue('Content-Range', 'bytes 0-8388607/178498359');

      zParams.AddFormField('data', 'application/octet-stream', '', zMemFile);
      ShowMessage(zIdHTTP.Put(cURL, zParams));
    except
      on E: EIdHTTPProtocolException do ShowMessage(IntToStr(zIdHTTP.ResponseCode));
      on E:Exception do ShowMessage('Error: Code: '+IntToStr(zIdHTTP.ResponseCode)+' - Message: '+E.Message);
    end;
  finally
    FreeAndNil(zMemFile);
    FreeAndNil(zIdHTTP);
end;
end;
</code>```

the error message that appears is as follows: "Connection reset by peer"

The request is being made with the TIDHTTP component, but I also tested it with other components and the error continues to happen.

Does anyone know how to fix this error ?

I've tried it with other components like REST, and I've also tested it with insomnia.

Body:
I was making an application to send backup files to the Drive, however, when I try to send the files in chunks, I am getting a 400 error in the first request.

procedure TMainForm.btnTesteClick(Sender: TObject);
const
  cURL = 'URL from requset';
  cFilePath = 'path of File';
var
  zIdHTTP: TIdHTTP;
  zParams: TIdMultiPartFormDataStream;
  zIOHandler: TIdSSLIOHandlerSocketOpenSSL;
  zMemFile: TFileStream;
begin
  zIdHTTP:= TIdHTTP.Create();
  zParams:=  TIdMultiPartFormDataStream.Create();
  zIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create();
  try
    zIOHandler.SSLOptions.SSLVersions := [sslvTLSv1_2];
    zIOHandler.SSLOptions.Mode := sslmUnassigned;
    zIOHandler.SSLOptions.VerifyMode:= [];
    zIOHandler.SSLOptions.VerifyDepth:=0;
    zIdHTTP.IOHandler:= zIOHandler;
    zIdHTTP.HandleRedirects:= True;

    try
      zMemFile:= TFileStream.Create(cFilePath, fmOpenReadWrite);

      zIdHTTP.Request.CustomHeaders.AddValue('Content-Length', '8388608');
      zIdHTTP.Request.CustomHeaders.AddValue('Content-Range', 'bytes 0-8388607/178498359');

      zParams.AddFormField('data', 'application/octet-stream', '', zMemFile);
      ShowMessage(zIdHTTP.Put(cURL, zParams));
    except
      on E: EIdHTTPProtocolException do ShowMessage(IntToStr(zIdHTTP.ResponseCode));
      on E:Exception do ShowMessage('Error: Code: '+IntToStr(zIdHTTP.ResponseCode)+' - Message: '+E.Message);
    end;
  finally
    FreeAndNil(zMemFile);
    FreeAndNil(zIdHTTP);
end;
end;

the error message that appears is as follows: "Connection reset by peer"

The request is being made with the TIDHTTP component, but I also tested it with other components and the error continues to happen.

Does anyone know how to fix this error ?

I've tried it with other components like REST, and I've also tested it with insomnia.


问:
Flex value for main view causing all of my content to dissapear
I am working on a react native coffee app and trying to create the lay out where I have

the header

the scrollable container holding my coffee

a footer with a text input

a '+' icon to add the coffees to the container

Currently the flex value of my main 'View' is causing my entire app to push to the top of the screen and i have no idea why. I can set the height and width to 100% without flex and i can fill the screen but then i cannot configure my footer properly (+ i know this is bad practice..)

What am i doing wrong with my styles?

```<code>const Main = () => {
    return(
        <View style={styles.container}>
            <View style={styles.header}>
                <Text style={styles.headerText}> List of Coffee </Text>
            </View>

            <ScrollView styles={styles.scrollContainer}>

            </ScrollView>

            <View styles={styles.footer}>
                <TextInput
                    styles={styles.textInput}
                    placeholder="add your latest coffee here"
                    placeholderTextColor="#EEE">
                </TextInput>
            </View>

            <TouchableOpacity style={styles.addButton}>
                <Text style={styles.addButtonText}>+</Text>
            </TouchableOpacity>
        </View>

    );};

const styles = StyleSheet.create({
    container: {
        flex:1,
        flexDirection:"column",
        backgroundColor: 'grey',
    },
    footer: {
        position: 'absolute',
        bottom: 10,
        left: 10,
        right: 10,
        backgroundColor: 'white',
        zIndex: 9,
    },
    header: {
        backgroundColor: 'black',
        alignItems: 'center',
        justifyContent: 'center',
        borderBottomWidth: 10,
        borderBottomColor: 'yellow' ,
        paddingTop: 20,
    },
    headerText: {
        color: 'white',
        fontSize: 36,
        padding: 26,
        fontWeight: "500",
        fontFamily: 'Helvetica',
    },
    scrollContainer:{
        marginBottom: 100,
    },
    textInput: {
        alignSelf: 'stretch',
        color: 'black',
        padding:20,
        backgroundColor: 'black',
        borderTopWidth: 2,
        borderTopColor: 'black',
        fontSize: 32,
    },
    addButton: {
        position: 'absolute',
        zIndex: 11,
        right: 20,
        bottom: 100,
        backgroundColor: 'black',
        width: 80,
        height: 80,
        borderRadius: 50,
        justifyContent: 'center',
        alignItems: 'center',
    } ,
    addButtonText:{
        color: '#FFD700',
        fontSize: 36,
        fontWeight: '700',
    },
});

export default Main;
</code>```

Body:
I am working on a react native coffee app and trying to create the lay out where I have

the header

the scrollable container holding my coffee

a footer with a text input

a '+' icon to add the coffees to the container

Currently the flex value of my main 'View' is causing my entire app to push to the top of the screen and i have no idea why. I can set the height and width to 100% without flex and i can fill the screen but then i cannot configure my footer properly (+ i know this is bad practice..)

What am i doing wrong with my styles?

const Main = () => {
    return(
        <View style={styles.container}>
            <View style={styles.header}>
                <Text style={styles.headerText}> List of Coffee </Text>
            </View>

            <ScrollView styles={styles.scrollContainer}>

            </ScrollView>

            <View styles={styles.footer}>
                <TextInput
                    styles={styles.textInput}
                    placeholder="add your latest coffee here"
                    placeholderTextColor="#EEE">
                </TextInput>
            </View>

            <TouchableOpacity style={styles.addButton}>
                <Text style={styles.addButtonText}>+</Text>
            </TouchableOpacity>
        </View>

    );};

const styles = StyleSheet.create({
    container: {
        flex:1,
        flexDirection:"column",
        backgroundColor: 'grey',
    },
    footer: {
        position: 'absolute',
        bottom: 10,
        left: 10,
        right: 10,
        backgroundColor: 'white',
        zIndex: 9,
    },
    header: {
        backgroundColor: 'black',
        alignItems: 'center',
        justifyContent: 'center',
        borderBottomWidth: 10,
        borderBottomColor: 'yellow' ,
        paddingTop: 20,
    },
    headerText: {
        color: 'white',
        fontSize: 36,
        padding: 26,
        fontWeight: "500",
        fontFamily: 'Helvetica',
    },
    scrollContainer:{
        marginBottom: 100,
    },
    textInput: {
        alignSelf: 'stretch',
        color: 'black',
        padding:20,
        backgroundColor: 'black',
        borderTopWidth: 2,
        borderTopColor: 'black',
        fontSize: 32,
    },
    addButton: {
        position: 'absolute',
        zIndex: 11,
        right: 20,
        bottom: 100,
        backgroundColor: 'black',
        width: 80,
        height: 80,
        borderRadius: 50,
        justifyContent: 'center',
        alignItems: 'center',
    } ,
    addButtonText:{
        color: '#FFD700',
        fontSize: 36,
        fontWeight: '700',
    },
});

export default Main;


问:
localStorage("clicked", "")but when you click a button, set it to to ("clicked", "yes")and this cannot be reversed until you quit (close) the page
I want to set localStorage to ("clicked", "") at all times, but when a button is clicked, change it to ("clicked", "yes") and this shouldn't be undone unless you leave the page and enter it again. Are there any ways to do this?

```<code>localStorage.setItem("clicked", "");

(function checkFunction(){
  if (localStorage.getItem("clicked") === "yes") {
    localStorage.setItem("discountCode", "iloveventurebox0943");
    document.getElementById("discount-code-input").value = localStorage.getItem("discountCode");
    var discountPercentageStringFilter = parseFloat(localStorage.getItem("Percentage"));
    discountPercentage.innerHTML = ("(20%)");
    var discountPercentageLS = localStorage.setItem("Percentage", "(20%)");
    var Subtotal = localStorage.getItem("Enterprise");
    toFixedFetch = (Subtotal * discountPercentageStringFilter);
    discountPricePrice.innerHTML = toFixedFetch.toFixed(2);
    var discountPricePriceLS = localStorage.setItem("Enterprise", toFixedFetch.toFixed(2));
    document.getElementById("discount-trigger").setAttribute("disabled", "");
    document.getElementById("discount-trigger").classList.add("disabled");
  }
  let discountTriggerBtn = document.getElementById("discount-trigger");
  discountTriggerBtn.addEventListener("click", function() {
  let targetVar = document.getElementById("discount-code-input");
  (function checkDiscount() {
      var valueFiller = targetVar.value;
      let discountCode = "iloveventurebox0943";
      if (valueFiller === discountCode) {
        var discountPercentageStringFilter = parseFloat(localStorage.getItem("Percentage"));
        discountPercentage.innerHTML = ("(20%)");
        var discountPercentageLS = localStorage.setItem("Percentage", "(20%)");
        var Subtotal = localStorage.getItem("Enterprise");
        toFixedFetch = (Subtotal * discountPercentageStringFilter);
        discountPricePrice.innerHTML = toFixedFetch.toFixed(2);
        var discountPricePriceLS = localStorage.setItem("Enterprise", toFixedFetch.toFixed(2));
        document.getElementById("discount-trigger").setAttribute("disabled", "");
        document.getElementById("discount-trigger").classList.add("disabled");

        localStorage.setItem("clicked", "yes");

        var Total = document.getElementById("total");
        Total.innerHTML = (Subtotal - discountPricePrice);
      }
    }
  )();
})
}())
</code>```

I thought I could loop over and over but I just ended up going in hopeless circles :((

Body:
I want to set localStorage to ("clicked", "") at all times, but when a button is clicked, change it to ("clicked", "yes") and this shouldn't be undone unless you leave the page and enter it again. Are there any ways to do this?

localStorage.setItem("clicked", "");

(function checkFunction(){
  if (localStorage.getItem("clicked") === "yes") {
    localStorage.setItem("discountCode", "iloveventurebox0943");
    document.getElementById("discount-code-input").value = localStorage.getItem("discountCode");
    var discountPercentageStringFilter = parseFloat(localStorage.getItem("Percentage"));
    discountPercentage.innerHTML = ("(20%)");
    var discountPercentageLS = localStorage.setItem("Percentage", "(20%)");
    var Subtotal = localStorage.getItem("Enterprise");
    toFixedFetch = (Subtotal * discountPercentageStringFilter);
    discountPricePrice.innerHTML = toFixedFetch.toFixed(2);
    var discountPricePriceLS = localStorage.setItem("Enterprise", toFixedFetch.toFixed(2));
    document.getElementById("discount-trigger").setAttribute("disabled", "");
    document.getElementById("discount-trigger").classList.add("disabled");
  }
  let discountTriggerBtn = document.getElementById("discount-trigger");
  discountTriggerBtn.addEventListener("click", function() {
  let targetVar = document.getElementById("discount-code-input");
  (function checkDiscount() {
      var valueFiller = targetVar.value;
      let discountCode = "iloveventurebox0943";
      if (valueFiller === discountCode) {
        var discountPercentageStringFilter = parseFloat(localStorage.getItem("Percentage"));
        discountPercentage.innerHTML = ("(20%)");
        var discountPercentageLS = localStorage.setItem("Percentage", "(20%)");
        var Subtotal = localStorage.getItem("Enterprise");
        toFixedFetch = (Subtotal * discountPercentageStringFilter);
        discountPricePrice.innerHTML = toFixedFetch.toFixed(2);
        var discountPricePriceLS = localStorage.setItem("Enterprise", toFixedFetch.toFixed(2));
        document.getElementById("discount-trigger").setAttribute("disabled", "");
        document.getElementById("discount-trigger").classList.add("disabled");

        localStorage.setItem("clicked", "yes");

        var Total = document.getElementById("total");
        Total.innerHTML = (Subtotal - discountPricePrice);
      }
    }
  )();
})
}())

I thought I could loop over and over but I just ended up going in hopeless circles :((


问:
Page does not go down to anchor id when button clicked on modal
There is a modal with a button that when clicked should scroll down the page to id. It works without modal, but when I click on button on modal it moves scroll behind modal.
https://prnt.sc/5pWOgcmApa4G

When button clicked it triggers this code

```<code> $('html, body').animate({
                scrollTop: $("#send-replybox").offset().top
            }, 500);
</code>```

I couldn't find similar question yet..
Maybe somebody knows how to make anchor work on modal (popup) ?

Body:
There is a modal with a button that when clicked should scroll down the page to id. It works without modal, but when I click on button on modal it moves scroll behind modal.
https://prnt.sc/5pWOgcmApa4G

When button clicked it triggers this code

 $('html, body').animate({
                scrollTop: $("#send-replybox").offset().top
            }, 500);

I couldn't find similar question yet..
Maybe somebody knows how to make anchor work on modal (popup) ?


问:
Failed to convert ipynb to pdf - Tinytex issue
I've been having this issue lately:

I followed the instructions present in this issue: https://github.com/jupyter/nbconvert/issues/1445 but I already have all the packages installed.


问:
Having Issue on Ubuntu Server Not able to find images folder with HTML (Issue do not happen on Windows)
I can get it to work on windows but I can not get it work on Ubuntu server. The file is in the images folder and inside that is the png file. The html is in the templates folder and inside the template folder is the images folder with the png file. I have the same setup on windows and it works.

```<code><!DOCTYPE html>
<html lang="en">
<head>
    <title>Search</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>

<div class= "container">
    <form action="/search" class="search-bar" method="GET">
        <label for="query">Search:</label><br>
        <input type="text" name="query" placeholder="Enter Serial Number"><br>
        <button type="submit"><img src="images/search.png"></button>
    </form>
</div>

</body>
</html>
</code>```

I try move the files and even copy the whole dir the issue persist. It suppose to show an image but it don't. Even my style.css not being found.

Body:
I can get it to work on windows but I can not get it work on Ubuntu server. The file is in the images folder and inside that is the png file. The html is in the templates folder and inside the template folder is the images folder with the png file. I have the same setup on windows and it works.

<!DOCTYPE html>

    <title>Search</title>
    <link rel="stylesheet" href="styles.css">

    <form action="/search" class="search-bar" method="GET">
        Search:

        <input type="text" name="query" placeholder="Enter Serial Number">

        <button type="submit"></button>
    </form>

I try move the files and even copy the whole dir the issue persist. It suppose to show an image but it don't. Even my style.css not being found.


问:
Data not appending to url when sending through Jquery and Backbone
Ive created a simple backbone.js app to check how it works.
The application lets user search for a book by title in MySQL database.
The application contains a text field and a button as such,

```<code> <input type="text" id="search" name="title"><be>
 <button id="searchBtn">Search</button>
</code>```

What I want is to send the data to the codeigniter 3 backend and get data related to the searched book.For sending the search keyword, Ive created a jquery function,

```<code><script>
    $(document).ready(function() {
        $("#searchBtn").click(function() {
            var Book = Backbone.Model.extend({
                url: function() {
                    var urlstr = "/tutorials/t5/todociapp/index.php/Restapi/book?title=" + this.get("title");
                    return urlstr;
                },
                idAttribute: "id",
                defaults: {
                    title: null,
                    author: null
                }
            });
            var book1 = new Book({
                "title": "Book1",
                // author:"Author1"
            });
            book1.fetch({
                async: false,
                success: function() {
                    alert("HEYYYY!" + book1.get('title'))
                }
            });
        });

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

I'm trying to append the searched keyword to the end of the URL and get the value from the backend using segments.

```<code>    public function book_get()
{
    if ($this->input->server('REQUEST_METHOD') == 'GET') {
        // $search = $this->input->get("search");
        $search = $this->uri->segment(3);
        $book = $this->BookModel->getBookByTitle($search);
        log_message('debug', "HEYYYYY");
        log_message('debug', $search);
        print json_encode($book);
    } elseif ($this->input->server('REQUEST_METHOD') == 'POST') {
        log_message('debug', "HEYYYYY POST");
        $data = $this->decode_data($this->input->raw_input_stream);
        $title = $data['title'];
        $author = $data['author'];
        $addBook = $this->BookModel->addBookToDB($title,$author);
        echo json_encode($addBook);
    }
}
</code>```

My problem is the searched keyword doesn't append to the end of the URL and if possible tell me how to display the author name for the searched book in the alert box.

Body:
Ive created a simple backbone.js app to check how it works.
The application lets user search for a book by title in MySQL database.
The application contains a text field and a button as such,

 <input type="text" id="search" name="title"><be>
 <button id="searchBtn">Search</button>

What I want is to send the data to the codeigniter 3 backend and get data related to the searched book.For sending the search keyword, Ive created a jquery function,

I'm trying to append the searched keyword to the end of the URL and get the value from the backend using segments.

    public function book_get()
{
    if ($this->input->server('REQUEST_METHOD') == 'GET') {
        // $search = $this->input->get("search");
        $search = $this->uri->segment(3);
        $book = $this->BookModel->getBookByTitle($search);
        log_message('debug', "HEYYYYY");
        log_message('debug', $search);
        print json_encode($book);
    } elseif ($this->input->server('REQUEST_METHOD') == 'POST') {
        log_message('debug', "HEYYYYY POST");
        $data = $this->decode_data($this->input->raw_input_stream);
        $title = $data['title'];
        $author = $data['author'];
        $addBook = $this->BookModel->addBookToDB($title,$author);
        echo json_encode($addBook);
    }
}

My problem is the searched keyword doesn't append to the end of the URL and if possible tell me how to display the author name for the searched book in the alert box.


问:
Deploy Azure Static Web App with Sveltekit and Fastapi
I am trying to deploy Sveltekit to Azure Static Web Apps with a Fastapi backend.  I think I am close, but not sure if what I want to do is even possible.  I went through a Microsoft article about creating a react app with an api and followed the steps outlined in the svelte-adapter-azure-swa.  I am using the fastapi function from another Microsoft learn, which I have successfully deployed on its own.

The Sveltekit function sk_render and the fastapi WrapperFunction are located in an api directory and are present within the staticwebapp project.

.

My app is deployed and renders, however I receive a 404 when trying to fetch from the fastapi function.

routes/+page.svelte

```<code><script>

    import { onMount } from "svelte";

    let userName = ""
    onMount(async function () {
      const response = await fetch('api/hello/Jon');
      const data = await response.json();
      console.log(data);
      userName = data.name
    });
</script>
<h1>Welcome to SvelteKit {userName}</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

</code>```

I am not sure if there is some type of configuration I am missing in the host.json or function.json.

host.json

```<code>{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  },
  "extensions":
  {
    "http":
    {
        "routePrefix": "api"
    }
  }
}

</code>```

function.json

```<code>{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "get",
        "post"
      ],
      "route": "{*route}"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "$return"
    }
  ]
}

</code>```

Thanks

Body:
I am trying to deploy Sveltekit to Azure Static Web Apps with a Fastapi backend.  I think I am close, but not sure if what I want to do is even possible.  I went through a Microsoft article about creating a react app with an api and followed the steps outlined in the svelte-adapter-azure-swa.  I am using the fastapi function from another Microsoft learn, which I have successfully deployed on its own.

The Sveltekit function sk_render and the fastapi WrapperFunction are located in an api directory and are present within the staticwebapp project.

.

My app is deployed and renders, however I receive a 404 when trying to fetch from the fastapi function.

routes/+page.svelte

Welcome to SvelteKit {userName}

Visit kit.svelte.dev to read the documentation

I am not sure if there is some type of configuration I am missing in the host.json or function.json.

host.json

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  },
  "extensions":
  {
    "http":
    {
        "routePrefix": "api"
    }
  }
}

function.json

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "get",
        "post"
      ],
      "route": "{*route}"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "$return"
    }
  ]
}

Thanks


问:
my flutter app is not taking location in real device at first time but work properly in emulator?
This code is working fine in emulator but it doesn't work properly in real device . This code for taking user location but when i open 1st time app it only ask permission for location and doesn't getlocation if restart my application then it take location.

```<code>@override
  void initState() {
    // TODO: implement initState
    super.initState();
    showAddress(context);
    didChangeDependencies();
  }

  Future showAddress(BuildContext context) async {
    await locationService();
  }

  void getYourAddress() {
    homeServices.addAddress(
      context: context,
      address: address,
      latitude: lat!,
      logitude: long!,
      locality: locality,
    );
  }

  double? lat;

  double? long;

  String address = '';
  String locality = '';

//For convert lat long to address
  getAddress(lat, long) async {
    List<geocoding.Placemark> placemarks =
        await geocoding.placemarkFromCoordinates(lat, long);
    if (mounted) {
      setState(() {
        address =
            "${placemarks[0].street!} ${placemarks[0].subLocality!} ${placemarks[0].locality!} ${placemarks[0].postalCode!} ${placemarks[0].country!} ";
        if (placemarks[0].locality == '') {
          locality = placemarks[0].street!;
        } else {
          locality = placemarks[0].locality!;
        }
      });
    }

    for (int i = 0; i < placemarks.length; i++) {
      print("INDEX $i ${placemarks[i]}");
    }
    getYourAddress();
  }

  Future locationService() async {
    Location location = Location();

    bool serviceEnabled;
    PermissionStatus permissionLocation;
    LocationData locData;

    serviceEnabled = await location.serviceEnabled();
    if (serviceEnabled == false) {
      serviceEnabled = await location.requestService();
      if (serviceEnabled == true) {
        permissionLocation = await location.hasPermission();
        if (permissionLocation == PermissionStatus.denied) {
          permissionLocation = await location.requestPermission();
          if (permissionLocation != PermissionStatus.granted) {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (_) => const IntroScreen(),
              ),
            );
          } else if (permissionLocation == PermissionStatus.granted) {
            await getLocation();
          }
        } else if (permissionLocation == PermissionStatus.granted) {
          await getLocation();
        }
      }
    } else if (serviceEnabled == true) {
      permissionLocation = await location.hasPermission();
      if (permissionLocation == PermissionStatus.denied) {
        permissionLocation = await location.requestPermission();
        if (permissionLocation != PermissionStatus.granted) {
          Navigator.push(
            context,
            MaterialPageRoute(
              builder: (_) => const IntroScreen(),
            ),
          );
        } else if (permissionLocation == PermissionStatus.granted) {
          await getLocation();
        }
      } else if (permissionLocation == PermissionStatus.granted) {
        await getLocation();
      }
    } else {
      Navigator.push(
        context,
        MaterialPageRoute(
          builder: (_) => const IntroScreen(),
        ),
      );
    }
  }

// Problem occuring at this point in emulator it work fine but not work in real device.
  getLocation() async {
    try {
      LocationData locData;
      Location location = Location();

      locData = await location.getLocation();

      if (mounted) {
        setState(() {
          lat = locData.latitude!;
          long = locData.longitude!;
        });
        await getAddress(lat, long);
      }
    } catch (e) {
      getLocation();
    }
  }
</code>```

This code is working fine in emulator but it doesn't work properly in real device . This code for taking user location but when i open 1st time app it only ask permission for location and doesn't getlocation if restart my application then it take location.
I am expecting this app to ask user for location permission and store data imidiately to database. But it doesn't doing it on first time after i restart app then it take location . Please help me to solve this problem.
I am use Using Location and Gecoding widget of flutter. when i try ti= check logs of my app in real device it show that asynchronous suspension.

Body:
This code is working fine in emulator but it doesn't work properly in real device . This code for taking user location but when i open 1st time app it only ask permission for location and doesn't getlocation if restart my application then it take location.

@override
  void initState() {
    // TODO: implement initState
    super.initState();
    showAddress(context);
    didChangeDependencies();
  }

  Future showAddress(BuildContext context) async {
    await locationService();
  }

  void getYourAddress() {
    homeServices.addAddress(
      context: context,
      address: address,
      latitude: lat!,
      logitude: long!,
      locality: locality,
    );
  }

  double? lat;

  double? long;

  String address = '';
  String locality = '';

//For convert lat long to address
  getAddress(lat, long) async {
    List<geocoding.Placemark> placemarks =
        await geocoding.placemarkFromCoordinates(lat, long);
    if (mounted) {
      setState(() {
        address =
            "${placemarks[0].street!} ${placemarks[0].subLocality!} ${placemarks[0].locality!} ${placemarks[0].postalCode!} ${placemarks[0].country!} ";
        if (placemarks[0].locality == '') {
          locality = placemarks[0].street!;
        } else {
          locality = placemarks[0].locality!;
        }
      });
    }

    for (int i = 0; i < placemarks.length; i++) {
      print("INDEX $i ${placemarks[i]}");
    }
    getYourAddress();
  }

  Future locationService() async {
    Location location = Location();

    bool serviceEnabled;
    PermissionStatus permissionLocation;
    LocationData locData;

    serviceEnabled = await location.serviceEnabled();
    if (serviceEnabled == false) {
      serviceEnabled = await location.requestService();
      if (serviceEnabled == true) {
        permissionLocation = await location.hasPermission();
        if (permissionLocation == PermissionStatus.denied) {
          permissionLocation = await location.requestPermission();
          if (permissionLocation != PermissionStatus.granted) {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (_) => const IntroScreen(),
              ),
            );
          } else if (permissionLocation == PermissionStatus.granted) {
            await getLocation();
          }
        } else if (permissionLocation == PermissionStatus.granted) {
          await getLocation();
        }
      }
    } else if (serviceEnabled == true) {
      permissionLocation = await location.hasPermission();
      if (permissionLocation == PermissionStatus.denied) {
        permissionLocation = await location.requestPermission();
        if (permissionLocation != PermissionStatus.granted) {
          Navigator.push(
            context,
            MaterialPageRoute(
              builder: (_) => const IntroScreen(),
            ),
          );
        } else if (permissionLocation == PermissionStatus.granted) {
          await getLocation();
        }
      } else if (permissionLocation == PermissionStatus.granted) {
        await getLocation();
      }
    } else {
      Navigator.push(
        context,
        MaterialPageRoute(
          builder: (_) => const IntroScreen(),
        ),
      );
    }
  }

// Problem occuring at this point in emulator it work fine but not work in real device.
  getLocation() async {
    try {
      LocationData locData;
      Location location = Location();

      locData = await location.getLocation();

      if (mounted) {
        setState(() {
          lat = locData.latitude!;
          long = locData.longitude!;
        });
        await getAddress(lat, long);
      }
    } catch (e) {
      getLocation();
    }
  }

This code is working fine in emulator but it doesn't work properly in real device . This code for taking user location but when i open 1st time app it only ask permission for location and doesn't getlocation if restart my application then it take location.
I am expecting this app to ask user for location permission and store data imidiately to database. But it doesn't doing it on first time after i restart app then it take location . Please help me to solve this problem.
I am use Using Location and Gecoding widget of flutter. when i try ti= check logs of my app in real device it show that asynchronous suspension.