问:
How to process frames using OpenCV with socketsrc Gstreamer pipeline in RTSP server?
I have this pipeline using an RTSP server with gstreamer. I really want to get the frame after the socketsrc, process it with opencv and then push it back to the pipeline.

I tried to add appsrc with appsink using this tutorial

https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html?gi-language=c

but I didn't manage to do it.

```<code> pipeline = "("
                     "socketsrc name= socket_src !  application/x-rtp , payload = 96  ,clock-rate=90000 ! "
                     "rtpjitterbuffer name= jitter_buffer ! rtph264depay ! h264parse name= parse ! rtph264pay name=pay0 pt=96 "
                     ")";

GstRTSPMountPoints *mounts = gst_rtsp_server_get_mount_points(p_server);
GstRTSPMediaFactory *new_factory = gst_rtsp_media_factory_new();
gst_rtsp_media_factory_set_profiles(new_factory, GST_RTSP_PROFILE_AVP);

gst_rtsp_media_factory_set_launch(new_factory, pipeline.c_str());
g_signal_connect(new_factory, "media-configure", (GCallback)media_configure_cb, this);

std::cout << domain_name << std::endl;

gst_rtsp_media_factory_set_shared(new_factory, false);

gst_rtsp_mount_points_add_factory(mounts, domain_name.c_str(), new_factory);
g_object_unref(mounts);
</code>```

any idea how can I get the frame here using OpenCV, process it, and push it back to the pipeline?

thanks!

Body:
I have this pipeline using an RTSP server with gstreamer. I really want to get the frame after the socketsrc, process it with opencv and then push it back to the pipeline.

I tried to add appsrc with appsink using this tutorial

https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html?gi-language=c

but I didn't manage to do it.

 pipeline = "("
                     "socketsrc name= socket_src !  application/x-rtp , payload = 96  ,clock-rate=90000 ! "
                     "rtpjitterbuffer name= jitter_buffer ! rtph264depay ! h264parse name= parse ! rtph264pay name=pay0 pt=96 "
                     ")";

GstRTSPMountPoints *mounts = gst_rtsp_server_get_mount_points(p_server);
GstRTSPMediaFactory *new_factory = gst_rtsp_media_factory_new();
gst_rtsp_media_factory_set_profiles(new_factory, GST_RTSP_PROFILE_AVP);

gst_rtsp_media_factory_set_launch(new_factory, pipeline.c_str());
g_signal_connect(new_factory, "media-configure", (GCallback)media_configure_cb, this);

std::cout << domain_name << std::endl;

gst_rtsp_media_factory_set_shared(new_factory, false);

gst_rtsp_mount_points_add_factory(mounts, domain_name.c_str(), new_factory);
g_object_unref(mounts);

any idea how can I get the frame here using OpenCV, process it, and push it back to the pipeline?

thanks!


来源: stackexchange

问:
Device compatibility with Geospatial API
Using the ARCore supported devices list provided by Google, I'm testing an app that uses the Geospatial API. Testing on a OnePlus 6 produces no errors, however, when using a Samsung Galaxy Tab S6 Lite and a Lenovo Yoga Tab 11 there are issues when using Geospatial API despite both devices being listed as supported too.

I'd like to know if there is another list of supported or tested devices for the Geospatial API, or if additional configurations are needed for tablets.

When calling the function session.isGeospatialModeSupported(Config.GeospatialMode.ENABLED) using a Samsung    Galaxy Tab S6 Lite and a  Lenovo Yoga Tab 11, the return value is false. Proceeding with the configuration of the session

```<code>session.configure(
    config.apply {
        geospatialMode = Config.GeospatialMode.ENABLED
    }
)
</code>```

Produces an error

```<code>################### Undecorated Trace Begin  #################
INVALID_ARGUMENT:
ARCoreError: third_party/arcore/ar/core/session.cc:482

ARCoreError: third_party/arcore/ar/geo/geoar_module.cc:314
Geospatial API is not supported on this device. [type.googleapis.com/util.ErrorSpacePayload='ArStatusErrorSpace::AR_ERROR_UNSUPPORTED_CONFIGURATION']
=== Source Location Trace: ===
third_party/arcore/ar/core/status.cc:171
third_party/arcore/ar/geo/geoar_module.cc:314
third_party/arcore/ar/core/session.cc:482`
</code>```

ContentLicense: CC BY-SA 4.0

Body:
Using the ARCore supported devices list provided by Google, I'm testing an app that uses the Geospatial API. Testing on a OnePlus 6 produces no errors, however, when using a Samsung Galaxy Tab S6 Lite and a Lenovo Yoga Tab 11 there are issues when using Geospatial API despite both devices being listed as supported too.

I'd like to know if there is another list of supported or tested devices for the Geospatial API, or if additional configurations are needed for tablets.

When calling the function session.isGeospatialModeSupported(Config.GeospatialMode.ENABLED) using a Samsung    Galaxy Tab S6 Lite and a  Lenovo Yoga Tab 11, the return value is false. Proceeding with the configuration of the session

session.configure(
    config.apply {
        geospatialMode = Config.GeospatialMode.ENABLED
    }
)

Produces an error

################### Undecorated Trace Begin  #################
INVALID_ARGUMENT:
ARCoreError: third_party/arcore/ar/core/session.cc:482

ARCoreError: third_party/arcore/ar/geo/geoar_module.cc:314
Geospatial API is not supported on this device. [type.googleapis.com/util.ErrorSpacePayload='ArStatusErrorSpace::AR_ERROR_UNSUPPORTED_CONFIGURATION']
=== Source Location Trace: ===
third_party/arcore/ar/core/status.cc:171
third_party/arcore/ar/geo/geoar_module.cc:314
third_party/arcore/ar/core/session.cc:482`


问:
asyncio.gather() and aiohttp not behaving as expected
I am pretty new to asyncio and I am trying to take its learning seriously so don't bash me too much.

I have written this code where I am trying to use asyncio and aiohttp to fetch input files from an external API while another coroutine fetches a file from an AWS s3 bucket and processes it.

Stripped down, my code looks like this:

```<code>async def fetchFromAPI():
...

print("Fetching from my API...")

try:
    chunk_counter = 1
    async with aiohttp.ClientSession(timeout=timeoutObject) as session:
        async with session.get(url, ) as r:
            r.raise_for_status()
            with open(rawResponseFilepath, "w+") as f:
                async for chunk in r.content.iter_chunked(8192):
                    chunk = chunk.decode('ASCII')
                    f.write(chunk)
                    print(f"Chunk #{chunk_counter} download completed.")
                    chunk_counter +=1

                print(f"Streaming complete. Datarecord file available at {rawResponseFilepath}")

except Exception as e:
    print(f"Could not query API. Error: {tb.format_exc()}.")
    raise

...

async def fetchFromS3AndProcess():
    ...
    print("Fetching from s3...")
    s3_client.download_file(filename, localfile)
    print("Done fetching from S3.")
    processFile(filname)
    print("Done processing.")

async def main():

    await asyncio.gather(fetchFromAPI(), fetchFromS3AndProcess())

if __name__ == '__main__':
    asyncio.run(main())
</code>```

What I am observing from the print statements (exemplified):

```<code>Fetching from my API...
Fetching from s3...
Done fetching from S3.
Done processing.
Chunk #1 download completed.
Chunk #2 download completed.
.
.
.
Chunk #10000 download completed.
Streaming complete. Datarecord file available at dataRecord.dr.
</code>```

What I am expecting instead is to see the download counter message be printed in between the S3 Fetching and processing print statements, signifying that the two downloads are actually starting at the same time.

Am I missing something obvious? Should I provide more info on the underlying coroutines to see if I am blocking somewhere?
If there is too little context to exemplify well I shall expand. Thanks!

Body:
I am pretty new to asyncio and I am trying to take its learning seriously so don't bash me too much.

I have written this code where I am trying to use asyncio and aiohttp to fetch input files from an external API while another coroutine fetches a file from an AWS s3 bucket and processes it.

Stripped down, my code looks like this:

async def fetchFromAPI():
...

print("Fetching from my API...")

try:
    chunk_counter = 1
    async with aiohttp.ClientSession(timeout=timeoutObject) as session:
        async with session.get(url, ) as r:
            r.raise_for_status()
            with open(rawResponseFilepath, "w+") as f:
                async for chunk in r.content.iter_chunked(8192):
                    chunk = chunk.decode('ASCII')
                    f.write(chunk)
                    print(f"Chunk #{chunk_counter} download completed.")
                    chunk_counter +=1

                print(f"Streaming complete. Datarecord file available at {rawResponseFilepath}")

except Exception as e:
    print(f"Could not query API. Error: {tb.format_exc()}.")
    raise

...

async def fetchFromS3AndProcess():
    ...
    print("Fetching from s3...")
    s3_client.download_file(filename, localfile)
    print("Done fetching from S3.")
    processFile(filname)
    print("Done processing.")

async def main():

    await asyncio.gather(fetchFromAPI(), fetchFromS3AndProcess())

if __name__ == '__main__':
    asyncio.run(main())

What I am observing from the print statements (exemplified):

Fetching from my API...
Fetching from s3...
Done fetching from S3.
Done processing.
Chunk #1 download completed.
Chunk #2 download completed.
.
.
.
Chunk #10000 download completed.
Streaming complete. Datarecord file available at dataRecord.dr.

What I am expecting instead is to see the download counter message be printed in between the S3 Fetching and processing print statements, signifying that the two downloads are actually starting at the same time.

Am I missing something obvious? Should I provide more info on the underlying coroutines to see if I am blocking somewhere?
If there is too little context to exemplify well I shall expand. Thanks!


问:
mongodb vs nodejs remove duplicat from several fields
After several unsuccessful attempts directly with mongodb aggregation, i switched to nodejs to perform this task, i manage to delete duplicates documents based on a single field, i would like to be able to delete duplicates documents based on several fields, my lack of experience with nodejs not letting me successfully complete this task, can someone help to remove duplicates based on several fields ?

here is my current code,

index.js :

```<code>const MongoClient = require("mongodb").MongoClient;
require("dotenv").config();

async function removeDups() {
  try {
    const client = await MongoClient.connect(process.env.DB_URL, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    });
    const DB = client.db(process.env.DB_NAME);
    const coll = DB.collection(process.env.COLL_NAME);
    const tempColl = DB.collection(process.env.TEMP_COLL_NAME);
    await tempColl.createIndex({ [process.env.UNIQUE_FIELD]: 1 }, { unique: true });
    const data = coll.find();
    const total = await data.count();
    let count = 0;
    let dupCount = 0;
    data.forEach(async (item) => {
      try {
        await tempColl.insertOne({ ...item });
        count++;
        console.log("Succesfuly Copied " + count + " unique documents.");
      } catch (error) {
        //Catch duplicate error and ignore, any other error panic.
        dupCount++;
      }
      if (count + dupCount == total) {
        console.log("Inserted " + count + " unique documents and removed "+ dupCount+" duplicates.");
        await DB.renameCollection(process.env.COLL_NAME,"temp_collection_review")
        await DB.renameCollection(process.env.TEMP_COLL_NAME,process.env.COLL_NAME)
        client.close();
        process.exit(1);
      }
    });
  } catch (error) {
    console.log(error);
  }
}

removeDups();
</code>```

.env :

```<code>DB_URL = "mongodb://127.0.0.1:27017"
</code>```
```<code>DB_NAME = test
</code>```
```<code>COLL_NAME = test
</code>```
```<code>UNIQUE_FIELD = user
</code>```
```<code>TEMP_COLL_NAME = products_temp
</code>```

(source: https://github.com/ceodigvijay/mongodb-remove-duplicates)

Body:
After several unsuccessful attempts directly with mongodb aggregation, i switched to nodejs to perform this task, i manage to delete duplicates documents based on a single field, i would like to be able to delete duplicates documents based on several fields, my lack of experience with nodejs not letting me successfully complete this task, can someone help to remove duplicates based on several fields ?

here is my current code,

index.js :

const MongoClient = require("mongodb").MongoClient;
require("dotenv").config();

async function removeDups() {
  try {
    const client = await MongoClient.connect(process.env.DB_URL, {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    });
    const DB = client.db(process.env.DB_NAME);
    const coll = DB.collection(process.env.COLL_NAME);
    const tempColl = DB.collection(process.env.TEMP_COLL_NAME);
    await tempColl.createIndex({ [process.env.UNIQUE_FIELD]: 1 }, { unique: true });
    const data = coll.find();
    const total = await data.count();
    let count = 0;
    let dupCount = 0;
    data.forEach(async (item) => {
      try {
        await tempColl.insertOne({ ...item });
        count++;
        console.log("Succesfuly Copied " + count + " unique documents.");
      } catch (error) {
        //Catch duplicate error and ignore, any other error panic.
        dupCount++;
      }
      if (count + dupCount == total) {
        console.log("Inserted " + count + " unique documents and removed "+ dupCount+" duplicates.");
        await DB.renameCollection(process.env.COLL_NAME,"temp_collection_review")
        await DB.renameCollection(process.env.TEMP_COLL_NAME,process.env.COLL_NAME)
        client.close();
        process.exit(1);
      }
    });
  } catch (error) {
    console.log(error);
  }
}

removeDups();

.env :

DB_URL = "mongodb://127.0.0.1:27017"

DB_NAME = test

COLL_NAME = test

UNIQUE_FIELD = user

TEMP_COLL_NAME = products_temp

(source: https://github.com/ceodigvijay/mongodb-remove-duplicates)


问:
Is there any option available to make setDomStorageEnabled to true in webview_flutter plugin?
I am trying to add webview inside my flutter application and for that i need to allow dom storage to access data stored. Currently i guess web_view flutter plugin not allows any way to setDomainStorageEnabled to true. But is there someone have any information of got any workaround fix for that?

It is working fine with native android as WebSetting allows me to make domstorageenable to true.

But in flutter webview_flutter plugin that dosen't seems possible.


问:
JAVA_TOOL_OPTIONS variables in Logback configuration
I have a small AWS Lambda function written in Java with a Logback attached to it for sending out error log emails. The variables needed for the Logback appender (basic SMTP details) are loaded into the Logback.xml configuration appender SMTPAppender in the usual format of "${smtpPort}" etc. The variables are maintained through the Lambda Function Environment variable: key=JAVA_TOOL_OPTIONS, value=-DsmtpPort=587 -DsmtpHost=xyz.
Here is the logback.xml configuration:

```<code><configuration debug="true">

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{ISO8601} %-5p [%t] %c - %m%n</pattern>
        </encoder>
    </appender>

    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
        <smtpPort>${smtpPort}</smtpPort>
        <STARTTLS>${startTls}</STARTTLS>
        <smtpHost>${smtpHost}</smtpHost>
        <username>${smtpUser}</username>
        <password>${smtpPassword}</password>
        <to>${logEmailTo}</to>
        <from>xxxx@xxxxxxxx.net</from>
        <subject>Error log [Scheduled Task Runner]</subject>
        <layout class="ch.qos.logback.classic.html.HTMLLayout">
            <pattern>%date%thread%level%logger%msg</pattern>
            <cssBuilder class="LambdaHandlers.util.ErrorEmailCssBuilder"/>
        </layout>
        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
            <!-- send just 10 log entries per email -->
            <bufferSize>10</bufferSize>
        </cyclicBufferTracker>
    </appender>

    <logger name="org.apache.commons.httpclient" level="OFF"/>
    <logger name="httpclient.wire.header" level="OFF"/>
    <logger name="httpclient.wire.content" level="OFF"/>
    <logger name="httpclient.wire" level="OFF"/>
    <logger name="org.apache.http" level="OFF"/>
    <logger name="io.micrometer" level="INFO"/>
    <logger name="software.amazon.awssdk" level="OFF"/>
    <logger name="io.netty" level="OFF"/>
    <logger name="org.apache.catalina.realm" level="DEBUG"/>
    <logger name="org.apache.axis" level="INFO"/>

    <root level="debug">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="EMAIL"/>
    </root>
</configuration>
</code>```

When the values are hardcoded in the logback.xml the email sending works as expected, however; after moving these to the JAVA_TOOL_OPTIONS bucket, the email stop working. The Lambda environment variables are correctly loaded on Lambda startup and can be accessed through the System.getProperty() in the Lambda context, providing the values from the environment variable.

Body:
I have a small AWS Lambda function written in Java with a Logback attached to it for sending out error log emails. The variables needed for the Logback appender (basic SMTP details) are loaded into the Logback.xml configuration appender SMTPAppender in the usual format of "${smtpPort}" etc. The variables are maintained through the Lambda Function Environment variable: key=JAVA_TOOL_OPTIONS, value=-DsmtpPort=587 -DsmtpHost=xyz.
Here is the logback.xml configuration:

<configuration debug="true">

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{ISO8601} %-5p [%t] %c - %m%n</pattern>
        </encoder>
    </appender>

    <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
        <smtpPort>${smtpPort}</smtpPort>
        <STARTTLS>${startTls}</STARTTLS>
        <smtpHost>${smtpHost}</smtpHost>
        <username>${smtpUser}</username>
        <password>${smtpPassword}</password>
        <to>${logEmailTo}</to>
        <from>xxxx@xxxxxxxx.net</from>
        <subject>Error log [Scheduled Task Runner]</subject>
        <layout class="ch.qos.logback.classic.html.HTMLLayout">
            <pattern>%date%thread%level%logger%msg</pattern>
            <cssBuilder class="LambdaHandlers.util.ErrorEmailCssBuilder"/>
        </layout>
        <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">

            <bufferSize>10</bufferSize>
        </cyclicBufferTracker>
    </appender>

    <logger name="org.apache.commons.httpclient" level="OFF"/>
    <logger name="httpclient.wire.header" level="OFF"/>
    <logger name="httpclient.wire.content" level="OFF"/>
    <logger name="httpclient.wire" level="OFF"/>
    <logger name="org.apache.http" level="OFF"/>
    <logger name="io.micrometer" level="INFO"/>
    <logger name="software.amazon.awssdk" level="OFF"/>
    <logger name="io.netty" level="OFF"/>
    <logger name="org.apache.catalina.realm" level="DEBUG"/>
    <logger name="org.apache.axis" level="INFO"/>

    <root level="debug">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="EMAIL"/>
    </root>
</configuration>

When the values are hardcoded in the logback.xml the email sending works as expected, however; after moving these to the JAVA_TOOL_OPTIONS bucket, the email stop working. The Lambda environment variables are correctly loaded on Lambda startup and can be accessed through the System.getProperty() in the Lambda context, providing the values from the environment variable.


问:
React with brotli compress (webpack) and Nginx
I'm zipping the front-end files in react and setting up a server in nginx to serve them.

Using gzip compression, I managed to get the server to return the front-end files normally, everything working correctly.

I find it difficult to do the same with brotli compression, I tried it in two ways.

Serving nginx the files without compression and setting it to compress (brotli) before sending to the client.

Compressing the front-end files with brotli via webpack and setting brotli_static in nginx.
I have to solve the problem in this way i.e. the front end compresses the files

But none of the above ways work, below some relevant information.

Other points:

Some other simple way to serve brotli files so I can validate if the error is in nginx or webpack compression ?

I followed this link to install nginx and brotli modules

Webpack Config

Nginx Config

Front-end compression with gzip and nginx gzip_static on
I just needed to enable gzip_static on;

brotli compression by nginx - brolti on;
the "content-encoding" remained the same, it should change

Compressing files in brotli by webpack and setting brotli_static on in nginx


问:
dynamically loading global css in nextjs
I have website which is themable. the website has a theme editor which allows for dynamically change the website font. When the user selects a font, I want the font to be loaded dynamically from a css file.

The website is a static website using next export thus there's no next server in play.

when trying to load global css in runtime from the theme editor component i'm getting

```<code>Global CSS cannot be imported from files other than your Custom <App>. Please move all global CSS imports to pages/_app.js.
Read more: https://err.sh/next.js/css-global
</code>```

But i cannot move the global css loading to the custom app file since i want to only load the fonts as needed (otherwise first load sucks).

using css modules doesn't seem like the right path since i need this to be applied globally.

The following SA question is similar, but the resolution there (moving css loading to custom app) is not valid in my case.

Next.js Global CSS cannot be imported from files other than your Custom <App>

What is the best way to achieve this?

Body:
I have website which is themable. the website has a theme editor which allows for dynamically change the website font. When the user selects a font, I want the font to be loaded dynamically from a css file.

The website is a static website using next export thus there's no next server in play.

when trying to load global css in runtime from the theme editor component i'm getting

Global CSS cannot be imported from files other than your Custom <App>. Please move all global CSS imports to pages/_app.js.
Read more: https://err.sh/next.js/css-global

But i cannot move the global css loading to the custom app file since i want to only load the fonts as needed (otherwise first load sucks).

using css modules doesn't seem like the right path since i need this to be applied globally.

The following SA question is similar, but the resolution there (moving css loading to custom app) is not valid in my case.

Next.js Global CSS cannot be imported from files other than your Custom <App>

What is the best way to achieve this?


问:
Prisma save model with many associations
This is possible in prisma ?

organization model has one array of store
store model has one array of phones

```<code>`
const organization = await this.prisma.organization.create({
  data: {
    name: accountForm.name,
    clifor: accountForm.clifor,
    store: {
      createMany:({
        data: stores
      }),
      phones:{
        createMany({
          data: phones
        })
      }
    }
  }
})`
</code>```

I dont found this in documentation of prisma.

Body:
This is possible in prisma ?

organization model has one array of store
store model has one array of phones

`
const organization = await this.prisma.organization.create({
  data: {
    name: accountForm.name,
    clifor: accountForm.clifor,
    store: {
      createMany:({
        data: stores
      }),
      phones:{
        createMany({
          data: phones
        })
      }
    }
  }
})`

I dont found this in documentation of prisma.


问:
Print an xlsx file with charts/pictures to pdf on Linux using Python
I've read following and many more:

print xlsx file from command line using ghostscript and libreoffice

Print chosen worksheets in excel files to pdf in python

Python Converting an Excel file (.xlsx) to a PDF (.pdf)

Python - Converting XLSX to PDF

Can you hard print an .xlsx file on Linux with Python?
(unasnwered)

Python library to open existing .xlsx workbook with charts

I have an xlsx file that contains lots of charts, tables and pictures (png watermarks inserted into the excel sheet as picture). E.g. see this sample template.

I want to print this to a pdf.

I'm on Linux and preferably want to use Python.

Closest I came was using libreoffice as described in answer #1 (Command used: libreoffice --headless --invisible --convert-to pdf ./Book1.xlsx) in list above. But all the text/formatting is messed up (whether I open the pdf file on Linux where I printed it or on Windows where I created the original xlsx file):

Same xlsx file printed on Windows using Excel App's print to pdf:

File does look ok when I open it in libreoffice-calc on linux:


问:
Using renv to maintain a project across multiple computers and R versions
Working across the home (R version4.1.0, Mac OS X intel i0) and work (R version 4.2.1, Apple M1) computers, I find that I have to reinitialize the project renv::init() followed by option 2 to re-initialize the lock file. Otherwise, the code doesn't work. Somehow, reinitializing the lock file every time I work on a different system seems wrong? What are other options? Can I instead install an R 4.2.1 on my home system in addition to R v4.1.0?</p>


问:
How to present this figure with a graph?Or how to create a reinforcement learning envireronment with allowing the agent to rotate and move workstation
enter image description here

I am wondering if there is way to present this layout as a graph given that there is node that present just the path?
my second question if it possible to make an environment allow an agent to place workstation to find the optimal configurations by himslef. if it yes can you give me a hint please.

I have tried to present this as a plot but I have no clue how to make it dynamic in which an agent can behave.


问:
API automation - Cucumber extent report 7 - capture request and response log in HTML report
I have created a API automation framework and using cucumber extent report I could generate the HTML report with result status

```<code>@RunWith(Cucumber.class)
@CucumberOptions(features="postrequest.feature",plugin="com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",glue={"st"},monochrome = true)
</code>```

I have created a log file to capture request and response payload data in stepdef

PrintStream log = new PrintStream(new FileOutputStream("payloadlog.txt"));
```

Question

it's possible tp  capture request and response payload data in cucumber HTML extent report 7?

Body:
I have created a API automation framework and using cucumber extent report I could generate the HTML report with result status

@RunWith(Cucumber.class)
@CucumberOptions(features="postrequest.feature",plugin="com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",glue={"st"},monochrome = true)

I have created a log file to capture request and response payload data in stepdef

PrintStream log = new PrintStream(new FileOutputStream("payloadlog.txt"));

Question

it's possible tp  capture request and response payload data in cucumber HTML extent report 7?


问:
Is there a way to implement code coverage for an app hosted in AWS using Jacoco?
Could somebody please share if any relevant docs for the same

In normal severs we add an agent,is it the same for AWS as well?


问:
how to implement client credentails flow using msal4j java
I have a forms auth in place for a jsp/servlet application which accepts username and password. I would like to keep the same form as in, an ablity to have user to input username and password but would like to implement auth using Azure Ad account using msal4j library. However all the users are MFA enabled in azure ad so would like to seek inputs if msal4j supports user auth. with MFA or any other flow can be implemented here like client-credentails OAuth2 flow?

I have tried implementing graph api for this requirement using https://github.com/Azure-Samples/ms-identity-java-daemon/blob/master/msal-client-credential-certificate/README.md  but since MFA is enabled for my AD users so getting this error - Unable to exchange auth code for token:
com.microsoft.aad.msal4j.MsalInteractionRequiredException: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000003-0000-0000-c000-000000000000'.


问:
Error 502 Bad Gateway connecting sequelize with aws rds
I am trying to connect to an aws rds database using sequelize when i connect using sls offline from serverless framework it connects correctly but when i use aws endpoint it gives me error 502 Bad Gateway,
as a note when connecting to mysql workbench i connect fine,
I attach my code-

File connection

`File connection

```<code>`const {Sequelize} = require('sequelize');
//const dbConfig = require('./db.config');

const db = new Sequelize('db_agenda', 'devRoot', 'admrds11', {
    host: 'db-agenda.mszfico67jcq.us-east-1.rds.amazonaws.com',
    port: 3306,
    dialect: 'mysql',
    logging: false,
    define: {
        timestamps: true
    },
    dialectOptions: {
        ssl:'Amazon RDS'
    },
    /* pool: {
        max: 5,
        min: 0,
        acquire: 30000,
        idle: 10000
    }, */
});`

`db.authenticate().then(() => {
    console.log("Connection has been stablised successfully...");
}).catch(err => {
    console.log("Unable to connect to the database", err)
})`
</code>```

module.exports = db;
`

Function connection

```<code>`module.exports.healthCheck = (event, context, callback) => {
  db.authenticate();

  callback(null,{
    statusCode:200,
    headers:{
      'Content-Type':'application/json'
    },
    body:JSON.stringify({
      success: true,
      message: '¡Exito!',
    })
  });
}`
</code>```

File serverless.yml

```<code>`functions:
  healthCheck:
    handler: handler.healthCheck
    events:
      - http:
          path: /
          method: get
          cors: true`
</code>```

I really appreciate your help

local proof attached

attached aws endpoint test

Body:
I am trying to connect to an aws rds database using sequelize when i connect using sls offline from serverless framework it connects correctly but when i use aws endpoint it gives me error 502 Bad Gateway,
as a note when connecting to mysql workbench i connect fine,
I attach my code-

File connection

`File connection

`const {Sequelize} = require('sequelize');
//const dbConfig = require('./db.config');

const db = new Sequelize('db_agenda', 'devRoot', 'admrds11', {
    host: 'db-agenda.mszfico67jcq.us-east-1.rds.amazonaws.com',
    port: 3306,
    dialect: 'mysql',
    logging: false,
    define: {
        timestamps: true
    },
    dialectOptions: {
        ssl:'Amazon RDS'
    },
    /* pool: {
        max: 5,
        min: 0,
        acquire: 30000,
        idle: 10000
    }, */
});`

`db.authenticate().then(() => {
    console.log("Connection has been stablised successfully...");
}).catch(err => {
    console.log("Unable to connect to the database", err)
})`

module.exports = db;
`

Function connection

`module.exports.healthCheck = (event, context, callback) => {
  db.authenticate();

  callback(null,{
    statusCode:200,
    headers:{
      'Content-Type':'application/json'
    },
    body:JSON.stringify({
      success: true,
      message: '¡Exito!',
    })
  });
}`

File serverless.yml

`functions:
  healthCheck:
    handler: handler.healthCheck
    events:
      - http:
          path: /
          method: get
          cors: true`

I really appreciate your help

local proof attached

attached aws endpoint test


问:
initialize Issue about Corda's flow test
I am trying to implement a flow test for my corda app written in java, but when I start to run a sample test to have a start I find this error:

Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
....
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker. (This mock maker is not supported on Android.)
Java               : 1.8
JVM vendor name    : Oracle Corporation
JVM vendor version : 25.341-b10
JVM name           : Java HotSpot(TM) 64-Bit Server VM
JVM version        : 1.8.0_341-b10
JVM info           : mixed mode
OS name            : Windows 11
OS version         : 10.0
```

I think the mockito plugin should be included in the corda.testing library that I have imported, and my corda environment set up should be fine since I can compile and run my corda app normally, and since I am runing the sample app, it should not be the code's problem. I have googled about it but didn't find anything useful, any suggestion about this will be helpful.

Body:
I am trying to implement a flow test for my corda app written in java, but when I start to run a sample test to have a start I find this error:

Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
....
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker. (This mock maker is not supported on Android.)
Java               : 1.8
JVM vendor name    : Oracle Corporation
JVM vendor version : 25.341-b10
JVM name           : Java HotSpot(TM) 64-Bit Server VM
JVM version        : 1.8.0_341-b10
JVM info           : mixed mode
OS name            : Windows 11
OS version         : 10.0

I think the mockito plugin should be included in the corda.testing library that I have imported, and my corda environment set up should be fine since I can compile and run my corda app normally, and since I am runing the sample app, it should not be the code's problem. I have googled about it but didn't find anything useful, any suggestion about this will be helpful.


问:
How to stop jquery fadeIn from scrolling the page
I am using jquery fadeIn like this

```<code>imgTag = '<img src="../../../images/leadGenAdPreview.jpg" alt=""/>';
$('#previewImg').hide();
$('#previewImg').html(imgTag).fadeIn(1000);
</code>```

What this does is, it scrolls up the page all the way up. The section which I want to fadeIn is quite a bit down on page. And I would best prefer page not to scroll at all. How can this be achieved ?

This is the entire snippet

```<code>$('#previewImg').hide();
$('#previewImg').html(imgTag).fadeTo(1000,100);
var currentlySelected = $('.inFoo-tabs-select');
$(currentlySelected).removeClass('inFoo-tabs-select'); $(obj).attr('class',$(obj).attr('class')+' inFoo-tabs-select');
goToScroll('infooterDemo');
</code>```

Because my target element is some way down the page, i was using scroll function. once i click on target element, fadeIn, and scroll down to it, next time I click on it, I dont want it to scroll back up.

ContentLicense: CC BY-SA 3.0

Body:
I am using jquery fadeIn like this

imgTag = '';
$('#previewImg').hide();
$('#previewImg').html(imgTag).fadeIn(1000);

What this does is, it scrolls up the page all the way up. The section which I want to fadeIn is quite a bit down on page. And I would best prefer page not to scroll at all. How can this be achieved ?

This is the entire snippet

$('#previewImg').hide();
$('#previewImg').html(imgTag).fadeTo(1000,100);
var currentlySelected = $('.inFoo-tabs-select');
$(currentlySelected).removeClass('inFoo-tabs-select'); $(obj).attr('class',$(obj).attr('class')+' inFoo-tabs-select');
goToScroll('infooterDemo');

Because my target element is some way down the page, i was using scroll function. once i click on target element, fadeIn, and scroll down to it, next time I click on it, I dont want it to scroll back up.


问:
DataMesh Architecture -Common data implementation
Am trying to make enterprise solution architecture using Datamesh architecture and stuck in a place like how common data across different domains gets ingested and where does it stores ? Any realworld implementation example will be helpful.

Thanks!

Architectural solution for my question


问:
My website return 500 internal server error after refreshing the page
I have a website built with Laravel and ReactJS uploaded to cPanel when I go to the link for the first time it is working fine, once I refresh the page I got an internal server error knowing this doesn't happen with the home page that has domain like this: example.com but with the URL that has a path like this: example.com/path

the following error appears in error_log file of server:

[core:error] [pid 23593] [client ..**.:*****] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer:

and the following error occurs in application page:

Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.

Please contact the server administrator at
webmaster@dashboard.haleemh.sa to inform them of the time this error
occurred, and the actions you performed just before this error.

More information about this error may be available in the server error
log.

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.

this is the .htaccess file:

```<code><IfModule mod_rewrite.c>
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Headers "*"
</IfModule>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>
DirectoryIndex first.html index.htm index.html index.php

RewriteEngine On

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

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
</code>```

Body:
I have a website built with Laravel and ReactJS uploaded to cPanel when I go to the link for the first time it is working fine, once I refresh the page I got an internal server error knowing this doesn't happen with the home page that has domain like this: example.com but with the URL that has a path like this: example.com/path

the following error appears in error_log file of server:

[core:error] [pid 23593] [client ..**.:*****] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer:

and the following error occurs in application page:

Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.

Please contact the server administrator at
webmaster@dashboard.haleemh.sa to inform them of the time this error
occurred, and the actions you performed just before this error.

More information about this error may be available in the server error
log.

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.

this is the .htaccess file:

<IfModule mod_rewrite.c>
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Headers "*"
</IfModule>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>
DirectoryIndex first.html index.htm index.html index.php

RewriteEngine On

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

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit


问:
Vagrant Azure - Cannot deploy VM (config.ssh.private_key_path)
When trying to deploy a VM to Azure using Vagrant I've got the message:

```<code>**.vagrant.d/gems/2.7.6/gems/vagrant-azure-2.0.0/lib/vagrant-azure/action/run_instance.rb:131:in `call': Please specify a secure key to use with config.ssh.private_key_path (RuntimeError) **
</code>```

When deploying locally, the ssh keys are created by Vagrant automatically, how to solve this?

Thanks.

Deploy a VM to Azure (CentOS)

```<code>**Vagrant.configure('2') do |config|
  config.vm.box = 'azure'
  #config.ssh.username = 'johndoe'
  #config.ssh.private_key_path = "~/.ssh/id_rsa"config.ssh
  config.vm.provider :azure do |azure, override|

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = "#########################"
    azure.client_id = '#####################################'
    azure.client_secret = '################################'
    azure.subscription_id = '######################'

    azure.vm_image_urn = 'OpenLogic:CentOS:7.5:latest'
    azure.instance_ready_timeout = 600
    azure.vm_password = '#############'
    azure.admin_username = "#############"
    override.winrm.transport = :ssl
    override.winrm.port = 5986
    override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
  end
  config.vm.synced_folder ".", "/var/www", type: "smb",
  smb_password: "###########", smb_username: "##########",
  mount_options: ["###########","password=############"]
end**
</code>```

Body:
When trying to deploy a VM to Azure using Vagrant I've got the message:

**.vagrant.d/gems/2.7.6/gems/vagrant-azure-2.0.0/lib/vagrant-azure/action/run_instance.rb:131:in `call': Please specify a secure key to use with config.ssh.private_key_path (RuntimeError) **

When deploying locally, the ssh keys are created by Vagrant automatically, how to solve this?

Thanks.

Deploy a VM to Azure (CentOS)

**Vagrant.configure('2') do |config|
  config.vm.box = 'azure'
  #config.ssh.username = 'johndoe'
  #config.ssh.private_key_path = "~/.ssh/id_rsa"config.ssh
  config.vm.provider :azure do |azure, override|

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = "#########################"
    azure.client_id = '#####################################'
    azure.client_secret = '################################'
    azure.subscription_id = '######################'

    azure.vm_image_urn = 'OpenLogic:CentOS:7.5:latest'
    azure.instance_ready_timeout = 600
    azure.vm_password = '#############'
    azure.admin_username = "#############"
    override.winrm.transport = :ssl
    override.winrm.port = 5986
    override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
  end
  config.vm.synced_folder ".", "/var/www", type: "smb",
  smb_password: "###########", smb_username: "##########",
  mount_options: ["###########","password=############"]
end**


问:
How do I calculate the mean of a column for an index with different values?
I am performing an EDA just to practice and learn a bit more about coding.

The problem is this:

I would like to calculate the mean of a column 'AQI' that stands for 'Air Quality Index' but only for specific values in index. My index is 'City' which has 26 different values (city names).

I have already calculated the means of all columns based on the city, for example:

```<code>Shillong_means = df.loc[df['City'] == 'Shillong', ['PM2.5', 'PM10', 'NO', 'NO2', 'NOx', 'NH3', 'CO', 'SO2',
       'O3', 'Benzene', 'Toluene', 'AQI', 'AQI_Bucket_num']].mean() # Columns mean for Shillong city
</code>```

This is the mean for every numeric columns with respect to Shillong City.

I have 25 lines like this (for other cities), but they are not together in a list (I think it would be easier to do if the were -- like, a list with only cities AQI_mean values)

So, basically, I am trying to create an combo chart, where in the x-axis I have the cities (26 different bar graphs), y-axis with AQI_mean values for each city, and a line plot with the national_mean (which I have already calculated) as follows:

```<code>national_AQI_mean = df['AQI'].mean()
national_AQI_mean
</code>```

I have also tried to create a list containing the AQI_means for each city in order to plot a barplot.

```<code>Cities_AQI_list = list[Ahmedabad_means['AQI'], Aizawl_means['AQI'], Amaravati_means['AQI'], Amritsar_means['AQI'],
                      Bengaluru_means['AQI'], Bhopal_means['AQI'], Brajrajnagar_means['AQI'], Chandigarh_means['AQI'],
                      Chennai_means['AQI'], Coimbatore_means['AQI'], Delhi_means['AQI'], Ernakulam_means['AQI'],
                      Gurugram_means['AQI'], Guwahati_means['AQI'], Hyderabad_means['AQI'], Jaipur_means['AQI'],
                      Jorapokhar_means['AQI'], Kochi_means['AQI'], Kolkata_means['AQI'], Lucknow_means['AQI'],
                      Mumbai_means['AQI'], Patna_means['AQI'], Shillong_means['AQI'], Talcher_means['AQI'],
                      Thiruvananthapuram_means['AQI'], Visakhapatnam_means['AQI']]

plt.bar(df['City'].unique().tolist(), Cities_AQI_list)

</code>```

But it returns me an error:
unsupported operand type(s) for +: 'int' and 'types.GenericAlias'

I don't know why the list I created is generic Alias type. Shouldn't be "list"? (Information about this would be really nice as well)

My df length is 29531: 26 cities and daily record of gases emission during 5 years (not for all cities).

My goal is to plot a combo chart where x-axis is divided categorically into cities, y-axis is AQI_mean values, and the line is just a straight line in the with the national_AQI_mean value.

PS. just came up with another idea: I will try to groupby my df by cities. (Let me know if it is a good or bad idea).

Body:
I am performing an EDA just to practice and learn a bit more about coding.

The problem is this:

I would like to calculate the mean of a column 'AQI' that stands for 'Air Quality Index' but only for specific values in index. My index is 'City' which has 26 different values (city names).

I have already calculated the means of all columns based on the city, for example:

Shillong_means = df.loc[df['City'] == 'Shillong', ['PM2.5', 'PM10', 'NO', 'NO2', 'NOx', 'NH3', 'CO', 'SO2',
       'O3', 'Benzene', 'Toluene', 'AQI', 'AQI_Bucket_num']].mean() # Columns mean for Shillong city

This is the mean for every numeric columns with respect to Shillong City.

I have 25 lines like this (for other cities), but they are not together in a list (I think it would be easier to do if the were -- like, a list with only cities AQI_mean values)

So, basically, I am trying to create an combo chart, where in the x-axis I have the cities (26 different bar graphs), y-axis with AQI_mean values for each city, and a line plot with the national_mean (which I have already calculated) as follows:

national_AQI_mean = df['AQI'].mean()
national_AQI_mean

I have also tried to create a list containing the AQI_means for each city in order to plot a barplot.

Cities_AQI_list = list[Ahmedabad_means['AQI'], Aizawl_means['AQI'], Amaravati_means['AQI'], Amritsar_means['AQI'],
                      Bengaluru_means['AQI'], Bhopal_means['AQI'], Brajrajnagar_means['AQI'], Chandigarh_means['AQI'],
                      Chennai_means['AQI'], Coimbatore_means['AQI'], Delhi_means['AQI'], Ernakulam_means['AQI'],
                      Gurugram_means['AQI'], Guwahati_means['AQI'], Hyderabad_means['AQI'], Jaipur_means['AQI'],
                      Jorapokhar_means['AQI'], Kochi_means['AQI'], Kolkata_means['AQI'], Lucknow_means['AQI'],
                      Mumbai_means['AQI'], Patna_means['AQI'], Shillong_means['AQI'], Talcher_means['AQI'],
                      Thiruvananthapuram_means['AQI'], Visakhapatnam_means['AQI']]

plt.bar(df['City'].unique().tolist(), Cities_AQI_list)

But it returns me an error:
unsupported operand type(s) for +: 'int' and 'types.GenericAlias'

I don't know why the list I created is generic Alias type. Shouldn't be "list"? (Information about this would be really nice as well)

My df length is 29531: 26 cities and daily record of gases emission during 5 years (not for all cities).

My goal is to plot a combo chart where x-axis is divided categorically into cities, y-axis is AQI_mean values, and the line is just a straight line in the with the national_AQI_mean value.

PS. just came up with another idea: I will try to groupby my df by cities. (Let me know if it is a good or bad idea).


问:
The problem of binding a custom widget frame to the edges of the screen (Qt C++)
The problem is that my application has a custom frame, i.e. the standard frame is disabled using (Qt::FramelessWindowHint), and my problem is that the standard frame has the ability to snap to the edges of the screen and automatically expand (by half or full screen), while providing a choice of which application will be open nearby.

Expected result(https://i.stack.imgur.com/0MFtg.jpg)

How do I implement such functionality.
The custom frame itself is a widget, and several QLabels playing the role of borders
The functionality of moving the widget (frame) and changing its size is also individually implemented

Unfortunately I didn't find any information on the Internet


问:
Hide toolbar for Storybook docs
I would like to hide the toolbar only for docs pages. I tried the configuration shown here but this hides toolbar items for both stories and docs pages. And I still see globals in the docs toolbar as seen below:

Any possibility to configure it to hide toolbar completely on docs pages?

Note: I am on the latest beta version: 7.0.0-beta.25

Title: Hide toolbar for Storybook docs


问:
Cast to VARCHAR with precision
I'm trying to create a SqlBasicCall that casts the output from a UDF to VARCHAR(50). The UDF is a representation of the Oracle STANDARD_HASH function and the last step I would like to do is CAST the result to VARCHAR.

So to explain further, I have some SQL:

SELECT REGION_NAME FROM REGIONS
```
<p>I am writing some code that will create a HASH of the column. Therefore the outcome should be</p>
<pre class="lang-sql prettyprint-override"><code>SELECT CAST(STANDARD_HASH(REGION_NAME)AS VARCHAR(50)) FROM REGIONS
</code>```

The code I have so far:

//create Hash function
SqlNode[] HashFunctionOperandList = new SqlNode[1];
HashFunctionOperandList[0] = new SqlIdentifier("REGION_NAME",SqlParserPos.ZERO);
SqlBasicCall innerFunc = new SqlBasicCall(ORACLE_HASH, HashFunctionOperandList, SqlParserPos.ZERO);

//Create the Cast function
SqlNode[] functionOperandList = new SqlNode[2];
functionOperandList[0] = innerFunc;
functionOperandList[1] = new SqlBasicTypeNameSpec(SqlTypeName.VARCHAR, SqlParserPos.ZERO).getTypeName();

compliantFunction = new SqlBasicCall(new SqlCastFunction(), functionOperandList, SqlParserPos.ZERO);
```
<p>ORACLE_HASH is defined as a UDF elsewhere:</p>
<pre class="lang-java prettyprint-override"><code>public static SqlFunction ORACLE_HASH = new SqlFunction("STANDARD_HASH", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000, null, OperandTypes.ANY, SqlFunctionCategory.USER_DEFINED_FUNCTION);
</code>```

The current output is:

SELECT CAST(STANDARD_HASH("REGION_NAME") AS "VARCHAR") "REGION_NAME" FROM "REGIONS"
```
<p>Where what I need it to be is:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT CAST(STANDARD_HASH("REGION_NAME") AS VARCHAR(50)) "REGION_NAME" FROM "REGIONS"
</code>```

I believe my SqlBasicTypeNameSpec line is wrong (I'm sure it is), but I have no idea how to create a SqlIdentifer that gives me VARCHAR(50) and without the quotes.  I am sure I have fundamentally misunderstood something so thought I would ask the crowd.

Title: Cast to VARCHAR with precision

Body:
I'm trying to create a SqlBasicCall that casts the output from a UDF to VARCHAR(50). The UDF is a representation of the Oracle STANDARD_HASH function and the last step I would like to do is CAST the result to VARCHAR.

So to explain further, I have some SQL:

SELECT REGION_NAME FROM REGIONS

I am writing some code that will create a HASH of the column. Therefore the outcome should be

SELECT CAST(STANDARD_HASH(REGION_NAME)AS VARCHAR(50)) FROM REGIONS

The code I have so far:

//create Hash function
SqlNode[] HashFunctionOperandList = new SqlNode[1];
HashFunctionOperandList[0] = new SqlIdentifier("REGION_NAME",SqlParserPos.ZERO);
SqlBasicCall innerFunc = new SqlBasicCall(ORACLE_HASH, HashFunctionOperandList, SqlParserPos.ZERO);

//Create the Cast function
SqlNode[] functionOperandList = new SqlNode[2];
functionOperandList[0] = innerFunc;
functionOperandList[1] = new SqlBasicTypeNameSpec(SqlTypeName.VARCHAR, SqlParserPos.ZERO).getTypeName();

compliantFunction = new SqlBasicCall(new SqlCastFunction(), functionOperandList, SqlParserPos.ZERO);

ORACLE_HASH is defined as a UDF elsewhere:

public static SqlFunction ORACLE_HASH = new SqlFunction("STANDARD_HASH", SqlKind.OTHER_FUNCTION, ReturnTypes.VARCHAR_2000, null, OperandTypes.ANY, SqlFunctionCategory.USER_DEFINED_FUNCTION);

The current output is:

SELECT CAST(STANDARD_HASH("REGION_NAME") AS "VARCHAR") "REGION_NAME" FROM "REGIONS"

Where what I need it to be is:

SELECT CAST(STANDARD_HASH("REGION_NAME") AS VARCHAR(50)) "REGION_NAME" FROM "REGIONS"

I believe my SqlBasicTypeNameSpec line is wrong (I'm sure it is), but I have no idea how to create a SqlIdentifer that gives me VARCHAR(50) and without the quotes.  I am sure I have fundamentally misunderstood something so thought I would ask the crowd.


问:
How to stick Linear Layout(with child as recyclerview) in ScrollView at top of screen
How to stick linear layout at top and allow nested scrolling in Recycler view after it get stick to top of screen. Linear layout should stick as header in ScrollView then allow its children nested scrolling in recyclerview

Below is image of how initial layout will look like

After Scroll stick linear layout to top of screen and allow nested scrolling in recyclerview like below image

Below is layout xml

```<code><?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    android:scrollbars="none"
    tools:context=".ui.fragment.HomeFragment">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@drawable/background_gradient_primary">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="@drawable/layout_divider_16dp"
            android:orientation="vertical"
            android:visibility="gone"
            android:showDividers="middle|end">

            <include layout="@layout/layout_toolbar_dashboard" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/categoriesRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:layout_marginVertical="@dimen/margin_16dp"
                android:orientation="horizontal"
                android:paddingHorizontal="@dimen/margin_16dp"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:itemCount="6"
                tools:listitem="@layout/adapter_categories_item" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:background="@drawable/background_light_grey_top_corners">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="36dp"
                android:gravity="center"
                android:layout_marginVertical="@dimen/margin_8dp"
                android:orientation="vertical">

                <ImageView
                    android:id="@+id/right_action"
                    android:layout_width="40dp"
                    android:layout_height="6dp"
                    android:src="@drawable/background_line_divider_icon" />

            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/dashboardRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:itemCount="3"
                android:overScrollMode="never"
                tools:listitem="@layout/shimmer_category_item"
                android:padding="@dimen/margin_8dp"/>

        </LinearLayout>

    </LinearLayout>

</androidx.core.widget.NestedScrollView>
</code>```

Body:
How to stick linear layout at top and allow nested scrolling in Recycler view after it get stick to top of screen. Linear layout should stick as header in ScrollView then allow its children nested scrolling in recyclerview

Below is image of how initial layout will look like

After Scroll stick linear layout to top of screen and allow nested scrolling in recyclerview like below image

Below is layout xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    android:scrollbars="none"
    tools:context=".ui.fragment.HomeFragment">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@drawable/background_gradient_primary">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="@drawable/layout_divider_16dp"
            android:orientation="vertical"
            android:visibility="gone"
            android:showDividers="middle|end">

            <include layout="@layout/layout_toolbar_dashboard" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/categoriesRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:layout_marginVertical="@dimen/margin_16dp"
                android:orientation="horizontal"
                android:paddingHorizontal="@dimen/margin_16dp"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:itemCount="6"
                tools:listitem="@layout/adapter_categories_item" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:background="@drawable/background_light_grey_top_corners">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="36dp"
                android:gravity="center"
                android:layout_marginVertical="@dimen/margin_8dp"
                android:orientation="vertical">

                <ImageView
                    android:id="@+id/right_action"
                    android:layout_width="40dp"
                    android:layout_height="6dp"
                    android:src="@drawable/background_line_divider_icon" />

            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/dashboardRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:itemCount="3"
                android:overScrollMode="never"
                tools:listitem="@layout/shimmer_category_item"
                android:padding="@dimen/margin_8dp"/>

        </LinearLayout>

    </LinearLayout>

</androidx.core.widget.NestedScrollView>


问:
How to load and change inputs values saved in csv file using shiny in R?
I have a big shiny app. I will put here a smaller version with no outputs, just inputs. For now I have some inputs in a tab - Net Production. I have a second tab - Home - where I display all my selected inputs in a table. The Save action button creates a file called File (today's date).csv in a chosen directory ('My Directory') with all the selected inputs. What I need is to make the Load button change the inputs saved on the csv file. Basically what I want is to every different user have the option of loading the dashboard with his last saved inputs. If you know a better (and free) way to do this, feel free to share.

This is my reproducible app:

```<code>library(shiny)
library(shinydashboard)
library(dplyr)
library(purrr)
library(rlang)
library(stringr)
library(DT)
library(r2d3)
library(ggplot2)
library(data.table)
library(highcharter)
library(shinymanager)
library(RColorBrewer)
library(tidyr)
library(dashboardthemes)
library(readxl)
library(scales)
library(plotly)
library(quantmod)
library(lubridate)
library(shinyWidgets)
library(shinydashboardPlus)
library(shinyjs)
library(waiter)
library(fresh)
library(zoo)
library(magrittr)

header <- dashboardHeader(title =  'Dash',
                          dropdownMenuOutput('Notifications')
)

dashSidebar <- dashboardSidebar(minified = T, collapsed = T, width = 215,
                                sidebarMenu(
                                  menuItem(text = "Net Production",
                                           tabName = "GraphsTab",
                                           icon= icon('dollar-sign', lib = 'font-awesome'),
                                           badgeLabel = label_date, badgeColor = 'olive'
                                  ),
                                  menuItem(text = "Home",
                                           tabName = "HomeTab",
                                           icon = icon("bar-chart-o")
                                  ),
                                  menuItem(
                                    text = "File Explore",
                                    tabName = "FileExplore",
                                    icon= icon("file-text")
                                  )
                                )
)

dashBody <- dashboardBody(

  shinyDashboardThemeDIY(
    ### General
    appFontFamily = "Arial"                             #Application font.
    ,appFontColor = '#000000'                           #Application font colour.
      ,primaryFontColor = '#FFEC8B'                       #Primary status highlight font colour.
      ,infoFontColor = '#FFEC8B'                          #Info status highlight font colour.
      ,successFontColor =  '#FFEC8B'                      #Success status highlight font colour.
      ,warningFontColor =  '#FFEC8B'                      #Warning status highlight font colour.
      ,dangerFontColor =   '#FFEC8B'                      #Danger status highlight font colour.
      ,bodyBackColor =    '#ECF0F5'                       #Main page background colour. --- Cor de Fundo ---  igual a input: buttonBackColor

    ### header
    ,logoBackColor =           '#EE7942'                #Logo background colour.

    ,headerButtonBackColor =    '#EE7942'               #Sidebar toggle button background colour.
      ,headerButtonIconColor =  '#FFFFFF'                 #Sidebar toggle button icon colour.
      ,headerButtonBackColorHover = '#EB7337'             #Sidebar toggle button background colour: hovered.
      ,headerButtonIconColorHover = '#FFFFFF'             #Sidebar toggle button icon colour: hovered.

    ,headerBackColor = '#EE7942'                        #Top header background colour.
      ,headerBoxShadowColor = ""                          #Top header shadow colour.
    ,headerBoxShadowSize = "0px 0px 0px"                #Top header shadow size.

    ### sidebar
    ,sidebarBackColor = '#2F4F4F'                       #Sidebar background colour.
      ,sidebarPadding = 0                                 #Sidebar inner padding.

    ,sidebarMenuBackColor = "inherit"                   #Sidebar menu background colour.
    ,sidebarMenuPadding = 0                             #Sidebar menu inner padding.
    ,sidebarMenuBorderRadius = 0                        #Sidebar menu shape radius.

    ,sidebarShadowRadius = ""                           #Sidebar shadow radius.
    ,sidebarShadowColor = "0px 0px 0px"                 #Sidebar shadow colour.

    ,sidebarUserTextColor = '#FFEC8B'                   #Sidebar userbox text colour.

    ,sidebarSearchBackColor = '#FFFFFF'                 #Sidebar searchbox background colour.
      ,sidebarSearchIconColor = '#212529'                 #Sidebar searchbox icon colour.
      ,sidebarSearchBorderColor = '#DCDCDC'               # Sidebar searchbox border line colour.

    ,sidebarTabTextColor = '#E0FFFF'                    #Sidebar tab font colour.
      ,sidebarTabTextSize = 14                            #Sidebar tab font size.
    ,sidebarTabBorderStyle = "none"                     #Sidebar tab border line style.
    ,sidebarTabBorderColor = "none"                     #Sidebar tab border line colour.
    ,sidebarTabBorderWidth = 0                          #Sidebar tab border line width.

    ,sidebarTabBackColorSelected = '#244040'            #Sidebar tab background colour: selected.
      ,sidebarTabTextColorSelected = '#FFFFFF'            #Sidebar tab font colour: selected.
      ,sidebarTabRadiusSelected = "0px"                   #Sidebar tab shape radius: selected.

    ,sidebarTabBackColorHover = '#244040'               #Sidebar tab background colour: hovered.
      ,sidebarTabTextColorHover = '#FFFFFF'               #Sidebar tab font colour: hovered.
      ,sidebarTabBorderStyleHover = "none"                #Sidebar tab border line style: hovered.
    ,sidebarTabBorderColorHover = "none"                #Sidebar tab border line colour: hovered.
    ,sidebarTabBorderWidthHover = 0                     #Sidebar tab border line width: hovered.
    ,sidebarTabRadiusHover = "0px"                      #Sidebar tab shape radius: hovered.

    ### boxes
    ,boxBackColor = '#FFFFFF'                           #Box background colour.
      ,boxBorderRadius = 5                                #Box shape radius.
    ,boxShadowSize = "0px 0px 0px"                      #String. Box shadow size.
    ,boxShadowColor = ""                                #String. Box shadow colour.
    ,boxTitleSize = 19                                  #Numeric. Box title font size.
    ,boxDefaultColor =  '#FFEC8B'                       #String. Box default highlight colour.
      ,boxPrimaryColor = '#FFEC8B'                        #String. Box primary highlight colour.
      ,boxInfoColor = '#FFEC8B'                           #String. Box info highlight colour.
      ,boxSuccessColor = '#FFEC8B'                        #String. Box success highlight colour.
      ,boxWarningColor = '#FFEC8B'                        #String. Box warning highlight colour.
      ,boxDangerColor = '#FFEC8B'                         #String. Box danger highlight colour.

    ,tabBoxTabColor = '#FFFFFF'                         #String. Tab box tab background colour.
      ,tabBoxTabTextSize = 14                             #Numeric. Tab box tab font size.
    ,tabBoxTabTextColor = '#212529'                     #String. Tab box tab font colour.
      ,tabBoxTabTextColorSelected = '#212529'             #String. Tab box tab font colour: selected
      ,tabBoxBackColor = '#FFFFFF'                        #String. Tab box body background colour.
      ,tabBoxHighlightColor = '#EE7942'                   #String. Tab box highlight colour.
      ,tabBoxBorderRadius = 5                             #Numeric. Tab box shape radius.

    ### inputs
    ,buttonBackColor =  '#ECF0F5'                       #String. Button background colour. --- Igual a cor de fundo ---
      ,buttonTextColor = '#212529'                        #String. Button font colour.
      ,buttonBorderColor = '#D3D3D3'                      #String. Button border line colour.
      ,buttonBorderRadius = 5                             #Numeric. Button shape radius.

    ,buttonBackColorHover = '#DCDCDC'                   #String. Button background colour: hovered.
      ,buttonTextColorHover = '#212529'                   #String. Button font colour: hovered.
      ,buttonBorderColorHover = '#808080'                 #String. Button border line colour: hovered.

    ,textboxBackColor = '#FFFFFF'                       #String. Textbox background colour.
      ,textboxBorderColor = '#D3D3D3'                     #String. Textbox border line colour.
      ,textboxBorderRadius = 5                            #Numeric. Textbox shape radius.
    ,textboxBackColorSelect = '#DCDCDC'                 #String. Textbox background colour: selected.
      ,textboxBorderColorSelect = '#808080'               #String. Textbox border line colour: selected.

    ### tables
    ,tableBackColor = '#FFFFFF'                         #String. Table background colour.
      ,tableBorderColor = '#ECF0F1'                       #String. Table border line colour.
      ,tableBorderTopSize = 1                             #Numeric. Table header line size.
    ,tableBorderRowSize = 1                             #Numeric. Table row separator line size.
  ),

  tags$style(
    '
        @media (min-width: 768px){
          .sidebar-mini.sidebar-collapse .main-header .logo {
              width: 230px;
          }
          .sidebar-mini.sidebar-collapse .main-header .navbar {
              margin-left: 230px;
          }
        }'
  ),
  tabItems(
    tabItem("GraphsTab",

            # h1("BPI"),
            fluidRow(
              column(2,
                     box(id = "Datas_box", width = NULL, solidHeader = FALSE, status = NULL,title = NULL, style = "position:relative;width:100%;height:0;padding-bottom:40%;",
                         dateRangeInput(
                           inputId = "DateRange",
                           label= "Select dates",
                           format= "dd/mm/yyyy",
                           # start = paste0(year(today()),"/01/01"),
                           start = '2022/01/01'
                         ),
                         actionButton(
                           inputId = 'action_1',
                           label = '1m'
                         ),
                         actionButton(
                           inputId = 'action_2',
                           label = '3m'
                         ),
                         actionButton(
                           inputId = 'action_3',
                           label = '6m'
                         ),
                         actionButton(
                           inputId = 'action_4',
                           label = '1y'
                         ),
                         actionButton(
                           inputId = 'action_5',
                           label = 'YTD'
                         )
                     ),
                     tags$head(tags$style('#Datas_box .box-header{ display: none}'))
              ),
              column(2,
                     box(id = "Gup_box", width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:40%;",
                         pickerInput(inputId = "PickerGrupos",
                                     label= "Groups",
                                     choices= c("Dom","I","L","P","VP",'Cl','Pen'),
                                     options = pickerOptions(
                                       `actions-box` = TRUE),
                                     multiple = T,
                                     width = '100%',
                                     selected = c("Dom","I","L","P","VP",'Cl','Pen')
                         ),
                         prettySwitch(inputId = "Stacked_Switch",
                                      label = "NP Stacked",
                                      status = "default",
                                      fill = TRUE
                         ),
                         tags$head(tags$style('#Gup_box .box-header{ display: none}')),
                         tags$style(".bs-placeholder {color: #212529 !important;}")
                     )
              ),
              column(2,
                     box(id = "Fnd_box", width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:40%;",
                         prettySwitch(inputId = "Union_Switch",
                                      label = "Groups or Profiles",
                                      status = "default",
                                      fill = TRUE
                         ),
                         tags$head(tags$style('#Fnd_box .box-header{ display: none}'))
                     )
              ),
              column(3,
                     box(id = 'Perfis_box', width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:26%;",
                         pickerInput(inputId = 'PickerPerfis',
                                     label = "Profiles",
                                     choices = c('A','D','M','D','I','Outros'),
                                     options = pickerOptions(
                                       `actions-box` = TRUE),
                                     # style = "btn-primary"
                                     multiple = T
                         ),

                         tags$head(tags$style('#Perfis_box .box-header{ display: none}'))
                     )
              ),
              column(3,
                     box(id = "View_box", width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:26%;",
                         prettyRadioButtons (inputId = "DatesView",
                                             label = "Select view",
                                             choices = c("Days", "Weeks","Months","Years"),
                                             inline = T,
                                             shape = c("curve"),
                                             fill = TRUE,
                                             status = "danger"
                         )
                     ),
                     tags$head(tags$style('#View_box .box-header{ display: none}'))
              )
            )

    ),
    tabItem(tabName = "HomeTab",
            fluidRow(
              column(2, offset = 5,
                     box(id = 'User_box', width = NULL, solidHeader = FALSE, status = NULL,
                         textInput("name", "Name", ""),
                         actionButton(inputId = 'load_button', label = 'Load', icon = NULL, width = NULL),
                         actionButton(inputId = 'save_button', label = 'Save', icon = NULL, width = NULL)
                     ),
                     tags$head(tags$style('#User_box .box-header{ display: none}'))
              )
            ),
            fluidRow(
              h1("All inputs"),
              tableOutput("show_inputs")
            )

    )
  ))

ui <- shinydashboardPlus::dashboardPage(title = 'Dash',
                                        header,
                                        dashSidebar,
                                        dashBody
)

server <- function(input, output){

  saveData <- function(data) {
    outputDir <- 'My Directory'
    fileName <- paste("File ",as.character(Sys.Date()),".csv",sep = "")
    # Write the file to the local system
    write.csv(
      x = data,
      file = file.path(outputDir, fileName),
      row.names = FALSE, quote = TRUE
    )
  }

  loadData <- function() {
    # Read all the files into a list
    files <- list.files(outputDir, full.names = TRUE)
    data <- lapply(files, read.csv, stringsAsFactors = FALSE)
    # Concatenate all data together into one data.frame
    data <- do.call(rbind, data)
    data
  }

  #----------------------------------------------------------------------------#
  # Output: Inputs
  #----------------------------------------------------------------------------#

  AllInputs <- reactive({
    myvalues <- NULL
    newvalues <- NULL
    for(i in 1:length(names(input))){
      newvalues <- paste(names(input)[i], input[[names(input)[i]]], sep=":")
      myvalues <- append(myvalues, newvalues)
    }
    myvalues
  })

  output$show_inputs <- renderTable({
    AllInputs()
  })

  observeEvent(input$save_button, {

    saveData(AllInputs())
  })
}

shinyApp(ui = ui, server = server)
</code>```

For sharing the dashboard I use  the following code in a play_dashboard.R file:

```<code>#!/usr/bin/Rscript
rm(list=ls())

library(shiny)
library(shinydashboard)
library(profvis)

#options("encoding" = "UTF-8")

## working paths
setwd("My directory")
runApp(host="0.0.0.0",port=82)

#runApp(host="85.88.128.214",port=49152)
</code>```

With the following bat button:

```<code>@echo off
title esg_dash

"C:\Program Files\R\R-4.0.1\bin\Rscript.exe" -e "source('My Directory/play_dashboard.R')"

title Command Prompt
pause
</code>```

Body:
I have a big shiny app. I will put here a smaller version with no outputs, just inputs. For now I have some inputs in a tab - Net Production. I have a second tab - Home - where I display all my selected inputs in a table. The Save action button creates a file called File (today's date).csv in a chosen directory ('My Directory') with all the selected inputs. What I need is to make the Load button change the inputs saved on the csv file. Basically what I want is to every different user have the option of loading the dashboard with his last saved inputs. If you know a better (and free) way to do this, feel free to share.

This is my reproducible app:

library(shiny)
library(shinydashboard)
library(dplyr)
library(purrr)
library(rlang)
library(stringr)
library(DT)
library(r2d3)
library(ggplot2)
library(data.table)
library(highcharter)
library(shinymanager)
library(RColorBrewer)
library(tidyr)
library(dashboardthemes)
library(readxl)
library(scales)
library(plotly)
library(quantmod)
library(lubridate)
library(shinyWidgets)
library(shinydashboardPlus)
library(shinyjs)
library(waiter)
library(fresh)
library(zoo)
library(magrittr)

header <- dashboardHeader(title =  'Dash',
                          dropdownMenuOutput('Notifications')
)

dashSidebar <- dashboardSidebar(minified = T, collapsed = T, width = 215,
                                sidebarMenu(
                                  menuItem(text = "Net Production",
                                           tabName = "GraphsTab",
                                           icon= icon('dollar-sign', lib = 'font-awesome'),
                                           badgeLabel = label_date, badgeColor = 'olive'
                                  ),
                                  menuItem(text = "Home",
                                           tabName = "HomeTab",
                                           icon = icon("bar-chart-o")
                                  ),
                                  menuItem(
                                    text = "File Explore",
                                    tabName = "FileExplore",
                                    icon= icon("file-text")
                                  )
                                )
)

dashBody <- dashboardBody(

  shinyDashboardThemeDIY(
    ### General
    appFontFamily = "Arial"                             #Application font.
    ,appFontColor = '#000000'                           #Application font colour.
      ,primaryFontColor = '#FFEC8B'                       #Primary status highlight font colour.
      ,infoFontColor = '#FFEC8B'                          #Info status highlight font colour.
      ,successFontColor =  '#FFEC8B'                      #Success status highlight font colour.
      ,warningFontColor =  '#FFEC8B'                      #Warning status highlight font colour.
      ,dangerFontColor =   '#FFEC8B'                      #Danger status highlight font colour.
      ,bodyBackColor =    '#ECF0F5'                       #Main page background colour. --- Cor de Fundo ---  igual a input: buttonBackColor

    ### header
    ,logoBackColor =           '#EE7942'                #Logo background colour.

    ,headerButtonBackColor =    '#EE7942'               #Sidebar toggle button background colour.
      ,headerButtonIconColor =  '#FFFFFF'                 #Sidebar toggle button icon colour.
      ,headerButtonBackColorHover = '#EB7337'             #Sidebar toggle button background colour: hovered.
      ,headerButtonIconColorHover = '#FFFFFF'             #Sidebar toggle button icon colour: hovered.

    ,headerBackColor = '#EE7942'                        #Top header background colour.
      ,headerBoxShadowColor = ""                          #Top header shadow colour.
    ,headerBoxShadowSize = "0px 0px 0px"                #Top header shadow size.

    ### sidebar
    ,sidebarBackColor = '#2F4F4F'                       #Sidebar background colour.
      ,sidebarPadding = 0                                 #Sidebar inner padding.

    ,sidebarMenuBackColor = "inherit"                   #Sidebar menu background colour.
    ,sidebarMenuPadding = 0                             #Sidebar menu inner padding.
    ,sidebarMenuBorderRadius = 0                        #Sidebar menu shape radius.

    ,sidebarShadowRadius = ""                           #Sidebar shadow radius.
    ,sidebarShadowColor = "0px 0px 0px"                 #Sidebar shadow colour.

    ,sidebarUserTextColor = '#FFEC8B'                   #Sidebar userbox text colour.

    ,sidebarSearchBackColor = '#FFFFFF'                 #Sidebar searchbox background colour.
      ,sidebarSearchIconColor = '#212529'                 #Sidebar searchbox icon colour.
      ,sidebarSearchBorderColor = '#DCDCDC'               # Sidebar searchbox border line colour.

    ,sidebarTabTextColor = '#E0FFFF'                    #Sidebar tab font colour.
      ,sidebarTabTextSize = 14                            #Sidebar tab font size.
    ,sidebarTabBorderStyle = "none"                     #Sidebar tab border line style.
    ,sidebarTabBorderColor = "none"                     #Sidebar tab border line colour.
    ,sidebarTabBorderWidth = 0                          #Sidebar tab border line width.

    ,sidebarTabBackColorSelected = '#244040'            #Sidebar tab background colour: selected.
      ,sidebarTabTextColorSelected = '#FFFFFF'            #Sidebar tab font colour: selected.
      ,sidebarTabRadiusSelected = "0px"                   #Sidebar tab shape radius: selected.

    ,sidebarTabBackColorHover = '#244040'               #Sidebar tab background colour: hovered.
      ,sidebarTabTextColorHover = '#FFFFFF'               #Sidebar tab font colour: hovered.
      ,sidebarTabBorderStyleHover = "none"                #Sidebar tab border line style: hovered.
    ,sidebarTabBorderColorHover = "none"                #Sidebar tab border line colour: hovered.
    ,sidebarTabBorderWidthHover = 0                     #Sidebar tab border line width: hovered.
    ,sidebarTabRadiusHover = "0px"                      #Sidebar tab shape radius: hovered.

    ### boxes
    ,boxBackColor = '#FFFFFF'                           #Box background colour.
      ,boxBorderRadius = 5                                #Box shape radius.
    ,boxShadowSize = "0px 0px 0px"                      #String. Box shadow size.
    ,boxShadowColor = ""                                #String. Box shadow colour.
    ,boxTitleSize = 19                                  #Numeric. Box title font size.
    ,boxDefaultColor =  '#FFEC8B'                       #String. Box default highlight colour.
      ,boxPrimaryColor = '#FFEC8B'                        #String. Box primary highlight colour.
      ,boxInfoColor = '#FFEC8B'                           #String. Box info highlight colour.
      ,boxSuccessColor = '#FFEC8B'                        #String. Box success highlight colour.
      ,boxWarningColor = '#FFEC8B'                        #String. Box warning highlight colour.
      ,boxDangerColor = '#FFEC8B'                         #String. Box danger highlight colour.

    ,tabBoxTabColor = '#FFFFFF'                         #String. Tab box tab background colour.
      ,tabBoxTabTextSize = 14                             #Numeric. Tab box tab font size.
    ,tabBoxTabTextColor = '#212529'                     #String. Tab box tab font colour.
      ,tabBoxTabTextColorSelected = '#212529'             #String. Tab box tab font colour: selected
      ,tabBoxBackColor = '#FFFFFF'                        #String. Tab box body background colour.
      ,tabBoxHighlightColor = '#EE7942'                   #String. Tab box highlight colour.
      ,tabBoxBorderRadius = 5                             #Numeric. Tab box shape radius.

    ### inputs
    ,buttonBackColor =  '#ECF0F5'                       #String. Button background colour. --- Igual a cor de fundo ---
      ,buttonTextColor = '#212529'                        #String. Button font colour.
      ,buttonBorderColor = '#D3D3D3'                      #String. Button border line colour.
      ,buttonBorderRadius = 5                             #Numeric. Button shape radius.

    ,buttonBackColorHover = '#DCDCDC'                   #String. Button background colour: hovered.
      ,buttonTextColorHover = '#212529'                   #String. Button font colour: hovered.
      ,buttonBorderColorHover = '#808080'                 #String. Button border line colour: hovered.

    ,textboxBackColor = '#FFFFFF'                       #String. Textbox background colour.
      ,textboxBorderColor = '#D3D3D3'                     #String. Textbox border line colour.
      ,textboxBorderRadius = 5                            #Numeric. Textbox shape radius.
    ,textboxBackColorSelect = '#DCDCDC'                 #String. Textbox background colour: selected.
      ,textboxBorderColorSelect = '#808080'               #String. Textbox border line colour: selected.

    ### tables
    ,tableBackColor = '#FFFFFF'                         #String. Table background colour.
      ,tableBorderColor = '#ECF0F1'                       #String. Table border line colour.
      ,tableBorderTopSize = 1                             #Numeric. Table header line size.
    ,tableBorderRowSize = 1                             #Numeric. Table row separator line size.
  ),

  tags$style(
    '
        @media (min-width: 768px){
          .sidebar-mini.sidebar-collapse .main-header .logo {
              width: 230px;
          }
          .sidebar-mini.sidebar-collapse .main-header .navbar {
              margin-left: 230px;
          }
        }'
  ),
  tabItems(
    tabItem("GraphsTab",

            # h1("BPI"),
            fluidRow(
              column(2,
                     box(id = "Datas_box", width = NULL, solidHeader = FALSE, status = NULL,title = NULL, style = "position:relative;width:100%;height:0;padding-bottom:40%;",
                         dateRangeInput(
                           inputId = "DateRange",
                           label= "Select dates",
                           format= "dd/mm/yyyy",
                           # start = paste0(year(today()),"/01/01"),
                           start = '2022/01/01'
                         ),
                         actionButton(
                           inputId = 'action_1',
                           label = '1m'
                         ),
                         actionButton(
                           inputId = 'action_2',
                           label = '3m'
                         ),
                         actionButton(
                           inputId = 'action_3',
                           label = '6m'
                         ),
                         actionButton(
                           inputId = 'action_4',
                           label = '1y'
                         ),
                         actionButton(
                           inputId = 'action_5',
                           label = 'YTD'
                         )
                     ),
                     tags$head(tags$style('#Datas_box .box-header{ display: none}'))
              ),
              column(2,
                     box(id = "Gup_box", width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:40%;",
                         pickerInput(inputId = "PickerGrupos",
                                     label= "Groups",
                                     choices= c("Dom","I","L","P","VP",'Cl','Pen'),
                                     options = pickerOptions(
                                       `actions-box` = TRUE),
                                     multiple = T,
                                     width = '100%',
                                     selected = c("Dom","I","L","P","VP",'Cl','Pen')
                         ),
                         prettySwitch(inputId = "Stacked_Switch",
                                      label = "NP Stacked",
                                      status = "default",
                                      fill = TRUE
                         ),
                         tags$head(tags$style('#Gup_box .box-header{ display: none}')),
                         tags$style(".bs-placeholder {color: #212529 !important;}")
                     )
              ),
              column(2,
                     box(id = "Fnd_box", width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:40%;",
                         prettySwitch(inputId = "Union_Switch",
                                      label = "Groups or Profiles",
                                      status = "default",
                                      fill = TRUE
                         ),
                         tags$head(tags$style('#Fnd_box .box-header{ display: none}'))
                     )
              ),
              column(3,
                     box(id = 'Perfis_box', width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:26%;",
                         pickerInput(inputId = 'PickerPerfis',
                                     label = "Profiles",
                                     choices = c('A','D','M','D','I','Outros'),
                                     options = pickerOptions(
                                       `actions-box` = TRUE),
                                     # style = "btn-primary"
                                     multiple = T
                         ),

                         tags$head(tags$style('#Perfis_box .box-header{ display: none}'))
                     )
              ),
              column(3,
                     box(id = "View_box", width = NULL, solidHeader = FALSE, status = NULL, style = "position:relative;width:100%;height:0;padding-bottom:26%;",
                         prettyRadioButtons (inputId = "DatesView",
                                             label = "Select view",
                                             choices = c("Days", "Weeks","Months","Years"),
                                             inline = T,
                                             shape = c("curve"),
                                             fill = TRUE,
                                             status = "danger"
                         )
                     ),
                     tags$head(tags$style('#View_box .box-header{ display: none}'))
              )
            )

    ),
    tabItem(tabName = "HomeTab",
            fluidRow(
              column(2, offset = 5,
                     box(id = 'User_box', width = NULL, solidHeader = FALSE, status = NULL,
                         textInput("name", "Name", ""),
                         actionButton(inputId = 'load_button', label = 'Load', icon = NULL, width = NULL),
                         actionButton(inputId = 'save_button', label = 'Save', icon = NULL, width = NULL)
                     ),
                     tags$head(tags$style('#User_box .box-header{ display: none}'))
              )
            ),
            fluidRow(
              h1("All inputs"),
              tableOutput("show_inputs")
            )

    )
  ))

ui <- shinydashboardPlus::dashboardPage(title = 'Dash',
                                        header,
                                        dashSidebar,
                                        dashBody
)

server <- function(input, output){

  saveData <- function(data) {
    outputDir <- 'My Directory'
    fileName <- paste("File ",as.character(Sys.Date()),".csv",sep = "")
    # Write the file to the local system
    write.csv(
      x = data,
      file = file.path(outputDir, fileName),
      row.names = FALSE, quote = TRUE
    )
  }

  loadData <- function() {
    # Read all the files into a list
    files <- list.files(outputDir, full.names = TRUE)
    data <- lapply(files, read.csv, stringsAsFactors = FALSE)
    # Concatenate all data together into one data.frame
    data <- do.call(rbind, data)
    data
  }

  #----------------------------------------------------------------------------#
  # Output: Inputs
  #----------------------------------------------------------------------------#

  AllInputs <- reactive({
    myvalues <- NULL
    newvalues <- NULL
    for(i in 1:length(names(input))){
      newvalues <- paste(names(input)[i], input[[names(input)[i]]], sep=":")
      myvalues <- append(myvalues, newvalues)
    }
    myvalues
  })

  output$show_inputs <- renderTable({
    AllInputs()
  })

  observeEvent(input$save_button, {

    saveData(AllInputs())
  })
}

shinyApp(ui = ui, server = server)

For sharing the dashboard I use  the following code in a play_dashboard.R file:

#!/usr/bin/Rscript
rm(list=ls())

library(shiny)
library(shinydashboard)
library(profvis)

#options("encoding" = "UTF-8")

## working paths
setwd("My directory")
runApp(host="0.0.0.0",port=82)

#runApp(host="85.88.128.214",port=49152)

With the following bat button:

@echo off
title esg_dash

"C:\Program Files\R\R-4.0.1\bin\Rscript.exe" -e "source('My Directory/play_dashboard.R')"

title Command Prompt
pause


问:
Is there a way to disable last and first positions of a MUI Slider?
By default MUI Slider thumb is going out of bounds of the track by the radius of the thumb in the first and last positions.

Let's see some examples on the screenshot below:

screenshot 1

code behind it:

<Slider style={{ width: "400px" }} min={0} max={3} step={1} />
<Slider style={{ width: "400px" }} min={0} max={3} step={1} />
<Slider style={{ width: "400px" }} min={0} max={3} step={1} />
```
<ol>
<li>slider is in the first position</li>
<li>slider is in the midst position</li>
<li>slider is in the last position</li>
</ol>
<p>Here's how I want it to be:</p>
<p>screenshot 2</p>
<p>How I currently achieve that behaviour?</p>
<p>code behind it:</p>
<pre class="lang-js prettyprint-override"><code><Slider style={{ width: "400px" }} min={-0.081} max={3.085} step={1} />
<Slider style={{ width: "400px" }} min={-0.081} max={3.085} step={1} />
<Slider style={{ width: "400px" }} min={-0.081} max={3.085} step={1} />
</code>```

The side-effect to that code is that if we try, we can push the thumb to the right-most or left-most position (so it will be the same as on the first screenshot with the problem).

I was wondering how can one disable/disallow first and last positions of a Slider?

Maybe there are other ways to achieve this with css or something else, I'm open to any options.

Body:
By default MUI Slider thumb is going out of bounds of the track by the radius of the thumb in the first and last positions.

Let's see some examples on the screenshot below:

screenshot 1

code behind it:

<Slider style={{ width: "400px" }} min={0} max={3} step={1} />
<Slider style={{ width: "400px" }} min={0} max={3} step={1} />
<Slider style={{ width: "400px" }} min={0} max={3} step={1} />

slider is in the first position

slider is in the midst position

slider is in the last position

Here's how I want it to be:

screenshot 2

How I currently achieve that behaviour?

code behind it:

<Slider style={{ width: "400px" }} min={-0.081} max={3.085} step={1} />
<Slider style={{ width: "400px" }} min={-0.081} max={3.085} step={1} />
<Slider style={{ width: "400px" }} min={-0.081} max={3.085} step={1} />

The side-effect to that code is that if we try, we can push the thumb to the right-most or left-most position (so it will be the same as on the first screenshot with the problem).

I was wondering how can one disable/disallow first and last positions of a Slider?

Maybe there are other ways to achieve this with css or something else, I'm open to any options.