问:
PHP - items in array disappear
I'm try to create a simple calendar and replace the hour by the event in the database, but only the first event show up, the other one are not display. I use a fetch_all and a loop to go through and convert the date to match the one in the table. When I do a var_dump after the loop, all the item appear, but when I do it in my if conditions only the first one is shown.

My code:

```<code><tbody>
                        <?php

                        for ($b = 0; isset($row[$b]); $b++) {
                            $event = date('d M Y H:i', strtotime($row[$b][1]));
                            while ($hour <= 19) {
                                echo "<tr>";
                                for ($j = 0; $j <= 0; $j++) {
                                    $time1 = $hour . ":00";
                                    echo "<td>" . $time1 . "</td>";
                                }
                                for ($k = 0; isset($five_days[$k]); $k++) {
                                        $date_match = $five_days[$k].' '.$time1;
                                    if ($date_match === $event) {

                                        echo "<td>" . $row[$b][0]."</td>";
                                    } else {
                                        echo "<td>" . $time1 . "</td>";
                                    }
                                }
                                for ($j = 5; $j <= 6; $j++) {
                                    echo "<td>" . "Indisponible" . "</td>";
                                }
                                echo "</tr>";
                                $hour++;
                            }
                        }
                        ?>
                    </tbody>
</code>```

I try to move the for loop who give me trouble, and when I do var_dump I get an array with a first date, another the first and second date, and a third one with all 3 date, but they all have the same a 0 index. Someone advised me to use DateTime instead of Date/strtotime, but it's a bit complicated to use for me.

Title: PHP - items in array disappear

Body:
I'm try to create a simple calendar and replace the hour by the event in the database, but only the first event show up, the other one are not display. I use a fetch_all and a loop to go through and convert the date to match the one in the table. When I do a var_dump after the loop, all the item appear, but when I do it in my if conditions only the first one is shown.

My code:

                        <?php

                        for ($b = 0; isset($row[$b]); $b++) {
                            $event = date('d M Y H:i', strtotime($row[$b][1]));
                            while ($hour <= 19) {
                                echo "
";
                                for ($j = 0; $j <= 0; $j++) {
                                    $time1 = $hour . ":00";
                                    echo "" . $time1 . "	";
                                }
                                for ($k = 0; isset($five_days[$k]); $k++) {
                                        $date_match = $five_days[$k].' '.$time1;
                                    if ($date_match === $event) {

                                        echo "" . $row[$b][0]."	";
                                    } else {
                                        echo "" . $time1 . "	";
                                    }
                                }
                                for ($j = 5; $j <= 6; $j++) {
                                    echo "" . "Indisponible" . "	";
                                }
                                echo "
";
                                $hour++;
                            }
                        }
                        ?>

I try to move the for loop who give me trouble, and when I do var_dump I get an array with a first date, another the first and second date, and a third one with all 3 date, but they all have the same a 0 index. Someone advised me to use DateTime instead of Date/strtotime, but it's a bit complicated to use for me.


来源: stackexchange

问:
Call Stored Procedure from Entity Framework that returns compound object
I have a database first setup in .net6
I need to call a stored proc (Lets say it is called GetMyData)

The stored proc is going to return 5 columns from various tables and so does not map to a current entity model.

The only things I can find is to use the context model to return a stored proc result but that will not work as the result set does not map to an existing model. Or a convoluted ADO.Net style call that looks horrific and needs lots of code.

Is there a simple way to call a stored proc that returns various columns from many tables?

ContentLicense: CC BY-SA 4.0


问:
how to apply digital signature on all pages of pdf using PDFBox library
I need to digitally sign pdf document with multiple pages and apply signature box on all pages of the document. I need to use PDFBox Open source library.

I am able to sign single page of pdf


问:
Is there any way to set a queue when you run a command via bin/spark-sql, not via spark-conf?
I don't have access to sparkconf, but i need to use spark-sql cli, with specific queue.

I tried this, but it didn't work:

```<code>bin/spark-sql –-queue de -e 'MSCK REPAIR TABLE schema_name.table_name'
</code>```

Is there any way to set a queue when you run a command via bin/spark-sql, not via spark-conf?

Body:
I don't have access to sparkconf, but i need to use spark-sql cli, with specific queue.

I tried this, but it didn't work:

bin/spark-sql –-queue de -e 'MSCK REPAIR TABLE schema_name.table_name'

Is there any way to set a queue when you run a command via bin/spark-sql, not via spark-conf?


问:
Cannot create a RasterLayer object from this file - Chelsa climate tif file
I downloaded Chelsa bio files on my local directory.
And when I tried to create raster for my R project, I keep getting error with following message.

```<code>Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  :
  Cannot create a RasterLayer object from this file.
</code>```

My code was simple and I was able to create worldclim climate raster file with the same code.
and, cannot figure out the difference.

```<code>download.file(url = "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/1981-2010/bio/CHELSA_bio1_1981-2010_V.2.1.tif",
              destfile = "Chelsa/bio1.tif")
bio1 <- raster("Chelsa/bio1.tif")
</code>```

Could anyone advice on this?

I also tried

bio1 <- stack("Chelsa/bio1.tif")

But, similar error message popped out.

I also changed my directory - instead of putting it under subdirectory (named Chelsa), I directly put the file into my home directory. But, all didn't work.

Body:
I downloaded Chelsa bio files on my local directory.
And when I tried to create raster for my R project, I keep getting error with following message.

Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  :
  Cannot create a RasterLayer object from this file.

My code was simple and I was able to create worldclim climate raster file with the same code.
and, cannot figure out the difference.

download.file(url = "https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V2/GLOBAL/climatologies/1981-2010/bio/CHELSA_bio1_1981-2010_V.2.1.tif",
              destfile = "Chelsa/bio1.tif")
bio1 <- raster("Chelsa/bio1.tif")

Could anyone advice on this?

I also tried

bio1 <- stack("Chelsa/bio1.tif")

But, similar error message popped out.

I also changed my directory - instead of putting it under subdirectory (named Chelsa), I directly put the file into my home directory. But, all didn't work.


问:
What is the data type of 0XB when it was assign to variable like this $a = 0XB
As I mentioned earlier, in the script below, I don't know what is the data type of "0XB"?

```<code>$a = 0XB;
$b= 1;
$c= $a + $b;
var_dump($c);
</code>```

The result is 12, which means 0XB is 11, I am not sure how PHP interpreter 0XB is equal to 11.

Can someone give me an explanation regarding this one and the use cases of this data type?

Thank you in advanced

Body:
As I mentioned earlier, in the script below, I don't know what is the data type of "0XB"?

$a = 0XB;
$b= 1;
$c= $a + $b;
var_dump($c);

The result is 12, which means 0XB is 11, I am not sure how PHP interpreter 0XB is equal to 11.

Can someone give me an explanation regarding this one and the use cases of this data type?

Thank you in advanced


问:
How to Change My Account Link in WooCommerce New Account Email
The current template has the following,

```<code>
<?php
/**
 * Customer new account email
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-new-account.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates\Emails
 * @version 6.0.0
 */

defined( 'ABSPATH' ) || exit;

do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

<?php /* translators: %s: Customer username */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?></p>
<?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>
<p><?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '<strong>' . esc_html( $user_login ) . '</strong>', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated && $set_password_url ) : ?>
    <?php // If the password has not been set by the user during the sign up process, send them a link to set a new password ?>
    <p><a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Click here to set your new password.', 'woocommerce' ) ); ?></a></p>
<?php endif; ?>

<?php
/**
 * Show user-defined additional content - this is set in each email's settings.
 */
if ( $additional_content ) {
    echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}

do_action( 'woocommerce_email_footer', $email );

</code>```

But I am in need of changing the link to another page. How do I do that.

I tried to simply change the myaccount to login where the my page is,

```<code>make_clickable( esc_url( wc_get_page_permalink( 'login' ) ) ) );
</code>```

But it seems like not working.

Also, I'm required to remove the Click here to set your new password.

Please share your wisdom how I can do that. I am new to this thing. Thanks.

Body:
The current template has the following,

<?php
/**
 * Customer new account email
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-new-account.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce\Templates\Emails
 * @version 6.0.0
 */

defined( 'ABSPATH' ) || exit;

do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

<?php /* translators: %s: Customer username */ ?>

<?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ); ?>

<?php /* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */ ?>

<?php printf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), '' . esc_html( $user_login ) . '', make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>

<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated && $set_password_url ) : ?>
    <?php // If the password has not been set by the user during the sign up process, send them a link to set a new password ?>

<a href="<?php echo esc_attr( $set_password_url ); ?>"><?php printf( esc_html__( 'Click here to set your new password.', 'woocommerce' ) ); ?>

<?php endif; ?>

<?php
/**
 * Show user-defined additional content - this is set in each email's settings.
 */
if ( $additional_content ) {
    echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}

do_action( 'woocommerce_email_footer', $email );

But I am in need of changing the link to another page. How do I do that.

I tried to simply change the myaccount to login where the my page is,

make_clickable( esc_url( wc_get_page_permalink( 'login' ) ) ) );

But it seems like not working.

Also, I'm required to remove the Click here to set your new password.

Please share your wisdom how I can do that. I am new to this thing. Thanks.


问:
WSO2 Update SQL Query with optional parameters
I'm writing a sql update query. I have tried to do it both in DbReport and in DataService.
The table has 5 fields (the id + 4 more) and if I only want to update the first parameter, the others will set to null in database.

Example:
Url --> http://localhost/myservice?id=xxx
Body ( only sent "param_1" value:

```<code>{
    "body":{
        "PARAM_1": 1670217
    }
}
</code>```

DataService

```<code><operation name="updateRecargasById">
    <call-query href="updateRecargasById">
        <with-param name="PARAM_1" query-param="PARAM_1" />
    <with-param name="PARAM_2" query-param="PARAM_2" />
    <with-param name="PARAM_3" query-param="PARAM_3" />
    <with-param name="PARAM_4" query-param="PARAM_4" />
    <with-param name="ID" query-param="ID" />
    </call-query>
</operation>
</code>```
```<code><query id="updateQuery" useConfig="configDS">
     <sql>UPDATE TABLE SET PARAM_1 = :PARAM_1, PARAM_2= :PARAM_2, PARAM_3= :PARAM_3, PARAM_4= :PARAM_4 WHERE ID</sql>

     <param name="PARAM_1" ordinal="1" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="PARAM_2" ordinal="2" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="PARAM_3" ordinal="3" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="PARAM_4" ordinal="4" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="ID" ordinal="5" paramType="SCALAR" sqlType="STRING" type="IN" />
</query>
</code>```

Sequence

```<code><dataServiceCall serviceName="updateDS">
        <operations type="single">
            <operation name="updateQuery">
                <param evaluator="xml" expression="$body//PARAM_1" name="PARAM_1"/>
                <param evaluator="xml" expression="$body//PARAM_2" name="PARAM_2"/>
                <param evaluator="xml" expression="$body//PARAM_3" name="PARAM_3"/>
                <param evaluator="xml" expression="$body//PARAM_4" name="PARAM_4"/>
                <param evaluator="xml" expression="get-property('uri.var.id')" name="ID"/>
            </operation>
        </operations>
        <source type="inline"/>
        <target type="body"/>
    </dataServiceCall>
</code>```

Is there any way to write this query to set only the fields setting in the request body?

Kind regards!!

......................

Body:
I'm writing a sql update query. I have tried to do it both in DbReport and in DataService.
The table has 5 fields (the id + 4 more) and if I only want to update the first parameter, the others will set to null in database.

Example:
Url --> http://localhost/myservice?id=xxx
Body ( only sent "param_1" value:

{
    "body":{
        "PARAM_1": 1670217
    }
}

DataService

<operation name="updateRecargasById">
    <call-query href="updateRecargasById">
        <with-param name="PARAM_1" query-param="PARAM_1" />
    <with-param name="PARAM_2" query-param="PARAM_2" />
    <with-param name="PARAM_3" query-param="PARAM_3" />
    <with-param name="PARAM_4" query-param="PARAM_4" />
    <with-param name="ID" query-param="ID" />
    </call-query>
</operation>

<query id="updateQuery" useConfig="configDS">
     <sql>UPDATE TABLE SET PARAM_1 = :PARAM_1, PARAM_2= :PARAM_2, PARAM_3= :PARAM_3, PARAM_4= :PARAM_4 WHERE ID</sql>

     <param name="PARAM_1" ordinal="1" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="PARAM_2" ordinal="2" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="PARAM_3" ordinal="3" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="PARAM_4" ordinal="4" paramType="SCALAR" sqlType="STRING" optional="true" type="IN" />
     <param name="ID" ordinal="5" paramType="SCALAR" sqlType="STRING" type="IN" />
</query>

Sequence

<dataServiceCall serviceName="updateDS">
        <operations type="single">
            <operation name="updateQuery">
                <param evaluator="xml" expression="$body//PARAM_1" name="PARAM_1"/>
                <param evaluator="xml" expression="$body//PARAM_2" name="PARAM_2"/>
                <param evaluator="xml" expression="$body//PARAM_3" name="PARAM_3"/>
                <param evaluator="xml" expression="$body//PARAM_4" name="PARAM_4"/>
                <param evaluator="xml" expression="get-property('uri.var.id')" name="ID"/>
            </operation>
        </operations>
        <source type="inline"/>
        <target type="body"/>
    </dataServiceCall>

Is there any way to write this query to set only the fields setting in the request body?

Kind regards!!

......................


问:
How to use Bloc for beginner in flutter?
I am starting to use Bloc to manage state , I have learned that there are 3 types that are BlocBuilder, BlocListener and BlocConsummer, so which writing style is most commonly used?

I have referenced many sample projects on github, but it has too many ways of writing, so I would like to ask for a sample project to follow it (the one that you feel is best)

Thank you ^^!


问:
Irregular "write ECONNABORTED Error" with Flask request.authorization
I'm building python web API through Flask. I'm trying to add authorization mechanism with flask.request.authorization method. It works great when correct user information are provided. However, when I was trying to input unauthorized user information, it returns "Error: write ECONNABORTED" irregularly. What are the possibles causes of this?

I use Postman and input the authorization info under "Authorization" tab in Postman with type "Basic Auth".

For example, when input "Username" as "eric" and "Password" as "secret" in Postman "Authrization" tab, it works fine. But if input "Username" as "debbie" and "Password" as "secret", it sometimes shows "Error: write ECONNABORTED"

```<code>    app = Flask(__name__)

    def auth_required(f):
        @wraps(f)
        def decorated(*args, **kwargs):
            auth = request.authorization
            if auth and auth.username == 'eric' and auth.password == 'secret':
                return f(*args, **kwargs)
            return 'could not verify'
        return decorated

    @app.route('/upload', methods=['GET', 'POST'])
    @auth_required
    def upload():
        foo()
        return render_template('upload.html')
</code>```

"SSL certificate verification" is off, "Request timeout in ms" is set to 1000, "Use the system proxy" is checked

Body:
I'm building python web API through Flask. I'm trying to add authorization mechanism with flask.request.authorization method. It works great when correct user information are provided. However, when I was trying to input unauthorized user information, it returns "Error: write ECONNABORTED" irregularly. What are the possibles causes of this?

I use Postman and input the authorization info under "Authorization" tab in Postman with type "Basic Auth".

For example, when input "Username" as "eric" and "Password" as "secret" in Postman "Authrization" tab, it works fine. But if input "Username" as "debbie" and "Password" as "secret", it sometimes shows "Error: write ECONNABORTED"

    app = Flask(__name__)

    def auth_required(f):
        @wraps(f)
        def decorated(*args, **kwargs):
            auth = request.authorization
            if auth and auth.username == 'eric' and auth.password == 'secret':
                return f(*args, **kwargs)
            return 'could not verify'
        return decorated

    @app.route('/upload', methods=['GET', 'POST'])
    @auth_required
    def upload():
        foo()
        return render_template('upload.html')

"SSL certificate verification" is off, "Request timeout in ms" is set to 1000, "Use the system proxy" is checked


问:
Another one complicated LINQ query question
Could you, please, help me with this case?

I would also appreciate any recommendations on how to solve similar LINQ cases in the future.

I have:

```<code>List<long> ids = new List<long>();
List<Company> companies = new List<Company>();
List<Company> companiesOut = new List<Company>();

class Company
{
    public string name { get; set; }
    public List<Owner> owners { get; set; }
}

class Owner
{
    public long id { get; set; }
}
</code>```

I need convert this code to LINQ (which could be used as LINQ Specification from System.Linq.Expressions):

```<code>foreach (var company in companies)
{
    foreach (var owner in company.owners)
    {
        if (ids.Contains(owner.id))
        {
            companiesOut.Add(company);
            break;
        }
    }
}
</code>```

Thanks!

Body:
Could you, please, help me with this case?

I would also appreciate any recommendations on how to solve similar LINQ cases in the future.

I have:

List<long> ids = new List<long>();
List<Company> companies = new List<Company>();
List<Company> companiesOut = new List<Company>();

class Company
{
    public string name { get; set; }
    public List<Owner> owners { get; set; }
}

class Owner
{
    public long id { get; set; }
}

I need convert this code to LINQ (which could be used as LINQ Specification from System.Linq.Expressions):

foreach (var company in companies)
{
    foreach (var owner in company.owners)
    {
        if (ids.Contains(owner.id))
        {
            companiesOut.Add(company);
            break;
        }
    }
}

Thanks!


问:
PDF embed on github page does not work: 404 error occurs
I want to embed the pdf file as follows: https://www.codexworld.com/embed-pdf-document-file-in-html-web-page/

However, I just merely get the 404 file not found error.

Here is my github link:

https://github.com/gyulab/gyulab.github.io/blob/master/_posts/Projects/2021-10-15-ms482_midterm.md

https://gyulab.github.io//projects/2021/10/15/ms482_midterm.html

I have tried the following codes(the permanent link, local link, etc.), but all of these did not work.

```<code><embed src="https://gyulab.github.io/_posts/Projects/MS482_Report_20180583_Gyujun Jeong.pdf" type="application/pdf" />
</code>```
```<code><embed src="MS482_Report_20180583_Gyujun Jeong.pdf" type="application/pdf" width="100%" height="600px" />
</code>```
```<code><embed src="https://github.com/gyulab/gyulab.github.io/blob/853df1ac46c7fecab4ca7c98d2a2d70a4f1860c7/_posts/Projects/MS482_Report_20180583_Gyujun%20Jeong.pdf" type="application/pdf" width="100%" height="600px" />
</code>```

How could I solve this problem?

I tried to change the link variation stated on stackoverflow and does not work.

Body:
I want to embed the pdf file as follows: https://www.codexworld.com/embed-pdf-document-file-in-html-web-page/

However, I just merely get the 404 file not found error.

Here is my github link:

https://github.com/gyulab/gyulab.github.io/blob/master/_posts/Projects/2021-10-15-ms482_midterm.md

https://gyulab.github.io//projects/2021/10/15/ms482_midterm.html

I have tried the following codes(the permanent link, local link, etc.), but all of these did not work.

<embed src="https://gyulab.github.io/_posts/Projects/MS482_Report_20180583_Gyujun Jeong.pdf" type="application/pdf" />

<embed src="MS482_Report_20180583_Gyujun Jeong.pdf" type="application/pdf" width="100%" height="600px" />

<embed src="https://github.com/gyulab/gyulab.github.io/blob/853df1ac46c7fecab4ca7c98d2a2d70a4f1860c7/_posts/Projects/MS482_Report_20180583_Gyujun%20Jeong.pdf" type="application/pdf" width="100%" height="600px" />

How could I solve this problem?

I tried to change the link variation stated on stackoverflow and does not work.


问:
Two superimposing plots with one having no fill
Goal: -

1- Scatter datapoints csatlat and csatlon with a c=cloudlayerheight argument, the cloudlayerheight has some masked values.
cloudlayerheight.shape=(36950,),
len(csatlat)=len(csatlon)=36950.
For this I'm getting this plot

As you can see, there are some gaps in the plot for which cloudlayerheight has masked values. I'd like to have a boundary over the whole plot, i.e. Have those gaps filled by two lines with no fill. I'm aiming for this.

This is to show the path traced by the satellite.

2- Have a no fill boundary cover the entire track of satellite, so that the cloudlayerheight plot is visible.

What I have tried

```<code>plot=ax.scatter(csatlon,csatlat,c=cloudlayerheight,s=5,
norm=divnorm,
cmap='jet',
transform=ccrs.PlateCarree()) #1st plot

#For the boundary plot
ax.scatter(csatlon,csatlat,
edgecolors='black',
facecolors='none',
transform=ccrs.PlateCarree());
</code>```

But I am getting this result, which is not useful

Increasing the value of s argument for boundary plot is not working as it's not opaque in the inside, it's swallowing the first plot. I can't select a hline marker shape, because it throws positional argument follows keyword argument error.

Body:
Goal: -

1- Scatter datapoints csatlat and csatlon with a c=cloudlayerheight argument, the cloudlayerheight has some masked values.
cloudlayerheight.shape=(36950,),
len(csatlat)=len(csatlon)=36950.
For this I'm getting this plot

As you can see, there are some gaps in the plot for which cloudlayerheight has masked values. I'd like to have a boundary over the whole plot, i.e. Have those gaps filled by two lines with no fill. I'm aiming for this.

This is to show the path traced by the satellite.

2- Have a no fill boundary cover the entire track of satellite, so that the cloudlayerheight plot is visible.

What I have tried

plot=ax.scatter(csatlon,csatlat,c=cloudlayerheight,s=5,
norm=divnorm,
cmap='jet',
transform=ccrs.PlateCarree()) #1st plot

#For the boundary plot
ax.scatter(csatlon,csatlat,
edgecolors='black',
facecolors='none',
transform=ccrs.PlateCarree());

But I am getting this result, which is not useful

Increasing the value of s argument for boundary plot is not working as it's not opaque in the inside, it's swallowing the first plot. I can't select a hline marker shape, because it throws positional argument follows keyword argument error.


问:
tabulator: how to set the horizontal scrollbar on top of the table?
I am using tabulator to create a table with a high number of rows and columns.
Is there a way to have the horizontal scrollbar on top of the table ?</p>


问:
Plot Symmetric Triangle on a Stock chart created using MplFinance Animation

I have to create a plot like above on the live candle stick plot I have created. And it also needs to be updated in real-time as the news candles are formed. Can anyone help me out here?
I have already tried the tlines parameter of mplfinance.


问:
How to restore the truncated data after decimal point for existing records using SQL or Datastage?
I want to restore the truncated data after the decimal point due to the insufficient length of the column it is truncated now I wish to restore truncated data and remove the decimal point also.

We have an untruncated column in a different table based on that we have updated it with another field.

any code that had its last position truncated because of the decimal point will be restored.

Using DataStage or SQL

Example:

E10.3293   Actual data

E10.329 Before

E103293 After code update(requirement)


问:
cmake - overrid set(CMAKE_CXX_FLAGS ...) from command line
My client's cmake configuration includes the following boilerplate:

```<code>include(CheckCXXCompilerFlag)

# add compiler flag, if not already present
macro(add_compiler_flag flag supportsFlag)
    check_cxx_compiler_flag(${flag} ${supportsFlag})

    if(${supportsFlag} AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${flag}")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
    endif()
endmacro()

add_compiler_flag("-Werror=suggest-override" supportsSuggestOverride)
</code>```

This causes my build to fail because of missing override declarations in the header files for boost 1.81.

How can I override that flag from the command line?  I tried this...

```<code>cmake -DCMAKE_CXX_FLAGS="-Wno-error=suggest-override" ..
</code>```

...it did not work.

Body:
My client's cmake configuration includes the following boilerplate:

include(CheckCXXCompilerFlag)

# add compiler flag, if not already present
macro(add_compiler_flag flag supportsFlag)
    check_cxx_compiler_flag(${flag} ${supportsFlag})

    if(${supportsFlag} AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${flag}")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
    endif()
endmacro()

add_compiler_flag("-Werror=suggest-override" supportsSuggestOverride)

This causes my build to fail because of missing override declarations in the header files for boost 1.81.

How can I override that flag from the command line?  I tried this...

cmake -DCMAKE_CXX_FLAGS="-Wno-error=suggest-override" ..

...it did not work.


问:
Continue training CatBoostRanker model
Is it possible to continue training a CatBoostRanker model?
The function train has a parameter named init_model
but doesn't accept type CatBoostRanker.</p>

Title: Continue training CatBoostRanker model


问:
Express res.download() promise?
I am using res.download() within a try - catch block. As per the official documentation res.download allows for a callback function for error/completion handling. I would like to promisify the res.download so that any error is directly handled in the catch block, to simplify the code. Using promisify(res.download) will throw an error:

```<code>"Cannot read property 'sendFile' of undefined"
</code>```

Using promisify:

```<code>const download = promisify(response.download);
await download(someFilePath, 'someFileName');
</code>```

Has any of you ever used the Express response.download async/promisified?

Title: Express res.download() promise?

Body:
I am using res.download() within a try - catch block. As per the official documentation res.download allows for a callback function for error/completion handling. I would like to promisify the res.download so that any error is directly handled in the catch block, to simplify the code. Using promisify(res.download) will throw an error:

"Cannot read property 'sendFile' of undefined"

Using promisify:

const download = promisify(response.download);
await download(someFilePath, 'someFileName');

Has any of you ever used the Express response.download async/promisified?


问:
(How) can I add new output items with variable names / variable values?
I am new to Shiny, so there may be functionality that addresses my question below (or explicit reasons why what I'm trying to do does not work/should not be done that way), but my google-fu has let me down so I'm asking directly.

I am trying to process several (10 or so) tables in the same way, based on user input, and show the processed tables in the app. I am wondering what the best way to do this is, while trying to avoid repeating the same lines over and over again if possible.

In server, I have:

```<code>observeEvent(input$submit_button, {
    for(i in 1:nrow(config_file)){
        outname_temp <- config_file$outname[i] #config_file is read in when spinning up the app. output names are e.g. df1, df2
        df_temp <- get(config_file$df_name[i]) #all the source dataframes in config_file are also read in when spinning up the app
        df_temp_processed <- df_temp[which(df_temp$query_column == some_user_input),] #each dataframe is processed based on user input

        ### I want to output each processed dataframes into its own separate tab.

        ## Attempt 1: this does not work, gives the following error:
        ## Warning: Error in [<-: Can't index shinyoutput with `[[`
        output[paste0(outname_temp, '_processed')] <- DT::renderDataTable({ get(paste0(outname_temp, '_processed')) })

        # Attempt 2: doing it the following way works in that it doesnt throw an error,
        # but it is both clunky, it needs me to name the output$ variables explicitly,
        # and only returns the last variable stored in df_temp_processed
        if(i==1){
            output$df1_processed <- DT::renderDataTable({ df_temp_processed })
        }else{
            if(i==2){
                output$df2_processed <- DT::renderDataTable({ df_temp_processed })
            }
        }

        # Attempt 3: Trying to fix the 'last value stored in df_temp_processed is returned for ALL output tables' issue
        # I now store the processed dataframe in its own variable, and feed each of these variables separately to output$.
        # For some reason, this _still_ shows the same dataframe for all output$ values
        assign(paste0(outname_temp, '_processed'), df_temp_processed)

        if(i==1){
            output$df1_processed <- DT::renderDataTable({ get(paste0(outname_temp, '_processed')) })
        }else{
            if(i==2){
                output$df2_processed <- DT::renderDataTable({ get(paste0(outname_temp, '_processed')) })
            }
        }
    }

    # Attempt 4: I store the processed dataframes separately in the loop,
    # explicitly name the output$ variable to be populated,
    # explicitly name the dataframe it should be populated with.
    # This does what I wanted to do, but when I have tens of different dataframes
    # it adds up to a lot of repeated lines where the only difference is the variable names
    output$df1_processed <- DT::renderDataTable({ get(paste0('df1_processed')) })
    output$df2_processed <- DT::renderDataTable({ get(paste0('df2_processed')) })
})
</code>```

and in ui I have (remember I have around 10 tables in total):

```<code>mainPanel(
    tabPanel('Processed table 1', DT::dataTableOutput('df1_processed')),
    tabPanel('Processed table 2', DT::dataTableOutput('df2_processed')),

)
</code>```

My questions are:

Is there a way to add/index output based on dynamic/variable names, similarly to how one would  do this for dataframe column names?

Is it even reasonable to try to do that given that only the most recently value of df_temp_processed is returned across all tables anyway?

Is there any 'better' way of doing what I am trying to do, than my currently-working Attempt 4, or is the conclusion that I simply have to write out the same thing separately for each table, both in server and in ui?

Body:
I am new to Shiny, so there may be functionality that addresses my question below (or explicit reasons why what I'm trying to do does not work/should not be done that way), but my google-fu has let me down so I'm asking directly.

I am trying to process several (10 or so) tables in the same way, based on user input, and show the processed tables in the app. I am wondering what the best way to do this is, while trying to avoid repeating the same lines over and over again if possible.

In server, I have:

observeEvent(input$submit_button, {
    for(i in 1:nrow(config_file)){
        outname_temp <- config_file$outname[i] #config_file is read in when spinning up the app. output names are e.g. df1, df2
        df_temp <- get(config_file$df_name[i]) #all the source dataframes in config_file are also read in when spinning up the app
        df_temp_processed <- df_temp[which(df_temp$query_column == some_user_input),] #each dataframe is processed based on user input

        ### I want to output each processed dataframes into its own separate tab.

        ## Attempt 1: this does not work, gives the following error:
        ## Warning: Error in [<-: Can't index shinyoutput with `[[`
        output[paste0(outname_temp, '_processed')] <- DT::renderDataTable({ get(paste0(outname_temp, '_processed')) })

        # Attempt 2: doing it the following way works in that it doesnt throw an error,
        # but it is both clunky, it needs me to name the output$ variables explicitly,
        # and only returns the last variable stored in df_temp_processed
        if(i==1){
            output$df1_processed <- DT::renderDataTable({ df_temp_processed })
        }else{
            if(i==2){
                output$df2_processed <- DT::renderDataTable({ df_temp_processed })
            }
        }

        # Attempt 3: Trying to fix the 'last value stored in df_temp_processed is returned for ALL output tables' issue
        # I now store the processed dataframe in its own variable, and feed each of these variables separately to output$.
        # For some reason, this _still_ shows the same dataframe for all output$ values
        assign(paste0(outname_temp, '_processed'), df_temp_processed)

        if(i==1){
            output$df1_processed <- DT::renderDataTable({ get(paste0(outname_temp, '_processed')) })
        }else{
            if(i==2){
                output$df2_processed <- DT::renderDataTable({ get(paste0(outname_temp, '_processed')) })
            }
        }
    }

    # Attempt 4: I store the processed dataframes separately in the loop,
    # explicitly name the output$ variable to be populated,
    # explicitly name the dataframe it should be populated with.
    # This does what I wanted to do, but when I have tens of different dataframes
    # it adds up to a lot of repeated lines where the only difference is the variable names
    output$df1_processed <- DT::renderDataTable({ get(paste0('df1_processed')) })
    output$df2_processed <- DT::renderDataTable({ get(paste0('df2_processed')) })
})

and in ui I have (remember I have around 10 tables in total):

mainPanel(
    tabPanel('Processed table 1', DT::dataTableOutput('df1_processed')),
    tabPanel('Processed table 2', DT::dataTableOutput('df2_processed')),

)

My questions are:

Is there a way to add/index output based on dynamic/variable names, similarly to how one would  do this for dataframe column names?

Is it even reasonable to try to do that given that only the most recently value of df_temp_processed is returned across all tables anyway?

Is there any 'better' way of doing what I am trying to do, than my currently-working Attempt 4, or is the conclusion that I simply have to write out the same thing separately for each table, both in server and in ui?


问:
Ubuntu integration to windows domain
``
Hello

I am migrating an Ubuntu Bionic 18.4 Linux server to a windows domain
I followed the steps below:

```<code>1- update packages first.

2- install the required packages.
     sudo apt -y install realmd sssd sssd-tools sssd-ad  libnss-sss libpam-sss adcli samba-common-bin oddjob oddjob-mkhomedir packagekit
     sudo apt-get install -y krb5-user sssd-krb5
     pam ????

3- Server Network config

     create file 99_config.yaml  (/etc/netplan/99_config.yaml)
     configure IP , DNS server and domain

     Change server hostname to a fully qualified domain name
       sudo hostnamectl set-hostname serverName.mydomain

     change /etc/hosts
       add or update line  127.0.0.1  serverName.mydomain

     apply change : sudo netplan apply

4- Discover the domain
     realm discover mydomain (work fine)

5- Keberos config
     REALM (EN MAJUSCULE)= mydomain
     kdc = my domaine Active Directory Server IP
     admin_server = my domaine Active Directory Server Name

6- Join ubuntu server to the domain
     realm join MyNameServerIP  mamadi.fofana (work fine)

7- Modify pam to automatically create a home directory for AD users
     pam-auth-update
     Check “activate mkhomedir”.

8- Test to see if the integration is working correctlyPermalink
     id         myuserName@myDomain
     getent     myuserName@myDomain
     groups     myuserName@myDomain

All those 3 above commands work fine

9- Admin config
     Update sudoers file to include your domain administrators security group with full sudo access:
      sudo nano /etc/sudoers.d/admins

     Add the necessary lines to it. For example:
      user ALL=(ALL) ALL
      %Domain\ Admins ALL=(ALL) ALL

     To avoid adding the domain name to the username every time,  configure this.
      sudo nano /etc/sssd/sssd.conf

     Change the ‘use_fully_qualified_names’ value to False.
     Restart and check:
      sudo systemctl restart sssd

    allow authorization for some AD users or groups
     sudo realm permit myUserName@myDomain, someUserName@myDomain
     sudo realm permit -g 'Domain Admins'

    Login using SSH via another terminal:
     ssh -l myuserName@myDomain MyUbuntuServerIP
</code>```

At first it worked; several domain users managed to connect with ssh , fileZilla and directly on the server
with their domain credential.

The only concern was that the resolution didn't work with the ubuntu server name; we used the IP address
To fix the name resolution problem, I had to install and configure samba and nmbd

Suddenly after a few days, I couldn't connect to the server with the domain accounts
with SSH I have the message
Connection closed by ServerIP port 22

directly on the server
i have the message
Sorry that didn't work, please try again
I am however sure of the password, and other users have failed to connect

Do you have an idea of the origin of the problem or a way to debug to identify the source of the problem?
the migration worked at first, then stopped recognizing domain user passwords

I specify that although the users of the domain cannot connect,
the following commands still work and show correct outputs

```<code>realm discover mydomain (work fine)
   id myuserName@myDomain
   getent myuserName@myDomain
   groups myuserName@myDomain
</code>```

Please assist

```<code>8- Test to see if the integration is working correctlyPermalink
     id         myuserName@myDomain
     getent     myuserName@myDomain
     groups     myuserName@myDomain

All those 3 above commands work fine
</code>```

Title: Ubuntu integration to windows domain

Body:
``
Hello

I am migrating an Ubuntu Bionic 18.4 Linux server to a windows domain
I followed the steps below:

1- update packages first.

2- install the required packages.
     sudo apt -y install realmd sssd sssd-tools sssd-ad  libnss-sss libpam-sss adcli samba-common-bin oddjob oddjob-mkhomedir packagekit
     sudo apt-get install -y krb5-user sssd-krb5
     pam ????

3- Server Network config

     create file 99_config.yaml  (/etc/netplan/99_config.yaml)
     configure IP , DNS server and domain

     Change server hostname to a fully qualified domain name
       sudo hostnamectl set-hostname serverName.mydomain

     change /etc/hosts
       add or update line  127.0.0.1  serverName.mydomain

     apply change : sudo netplan apply

4- Discover the domain
     realm discover mydomain (work fine)

5- Keberos config
     REALM (EN MAJUSCULE)= mydomain
     kdc = my domaine Active Directory Server IP
     admin_server = my domaine Active Directory Server Name

6- Join ubuntu server to the domain
     realm join MyNameServerIP  mamadi.fofana (work fine)

7- Modify pam to automatically create a home directory for AD users
     pam-auth-update
     Check “activate mkhomedir”.

8- Test to see if the integration is working correctlyPermalink
     id         myuserName@myDomain
     getent     myuserName@myDomain
     groups     myuserName@myDomain

All those 3 above commands work fine

9- Admin config
     Update sudoers file to include your domain administrators security group with full sudo access:
      sudo nano /etc/sudoers.d/admins

     Add the necessary lines to it. For example:
      user ALL=(ALL) ALL
      %Domain\ Admins ALL=(ALL) ALL

     To avoid adding the domain name to the username every time,  configure this.
      sudo nano /etc/sssd/sssd.conf

     Change the ‘use_fully_qualified_names’ value to False.
     Restart and check:
      sudo systemctl restart sssd

    allow authorization for some AD users or groups
     sudo realm permit myUserName@myDomain, someUserName@myDomain
     sudo realm permit -g 'Domain Admins'

    Login using SSH via another terminal:
     ssh -l myuserName@myDomain MyUbuntuServerIP

At first it worked; several domain users managed to connect with ssh , fileZilla and directly on the server
with their domain credential.

The only concern was that the resolution didn't work with the ubuntu server name; we used the IP address
To fix the name resolution problem, I had to install and configure samba and nmbd

Suddenly after a few days, I couldn't connect to the server with the domain accounts
with SSH I have the message
Connection closed by ServerIP port 22

directly on the server
i have the message
Sorry that didn't work, please try again
I am however sure of the password, and other users have failed to connect

Do you have an idea of the origin of the problem or a way to debug to identify the source of the problem?
the migration worked at first, then stopped recognizing domain user passwords

I specify that although the users of the domain cannot connect,
the following commands still work and show correct outputs

realm discover mydomain (work fine)
   id myuserName@myDomain
   getent myuserName@myDomain
   groups myuserName@myDomain

Please assist

8- Test to see if the integration is working correctlyPermalink
     id         myuserName@myDomain
     getent     myuserName@myDomain
     groups     myuserName@myDomain

All those 3 above commands work fine


问:
How to use both Shadow and Border in CustomPainter Flutter
is there any way I could add a border to this shadowed paint instance below?

I tried to add a stroke with color but it can't paint both of them at the same time!

Code:

class MyPainter extends CustomPainter {
  final Shadow shadow;
  final CustomClipper<Path> clipper;

  MyPainter({
    required this.shadow,
    required this.clipper,
  });

  @override
  void paint(Canvas canvas, Size size) {
    final paint = shadow.toPaint();
    final path = clipper.getClip(size).shift(shadow.offset);
    canvas.drawPath(path, paint);
  }

  @override
  bool shouldRepaint(MyPainter oldDelegate) => false;

  @override
  bool shouldRebuildSemantics(MyPainter oldDelegate) => false;
}

```


问:
How to find same words in a string and keep track
I am making my own programming language using JS but when I attempt to put multiple words where it is expected to be an error, it has no errors, I don't know why .includes only gets one string and skips the others, could I get any help on the subject??

HTML:

```<code><!DOCTYPE html>
<html>
    <head>
        <title>HyperAnimator</title>
    </head>
    <body>
        <h1>HyperAnimator:</h1>
        <br>
        <b>Dark mode: <button onclick="DarkMode()">Toggle dark mode</button>
        <br>
        <br>
        <b>Input code:</b>
        <br>
        <!--<input type="text" id="Code">-->
        <textarea id="Code">
Main Anim[] class=>

<=ClassEnd</textarea>
        <br>
        <button onclick="Compile()">Compile</button>
        <br>
        <br>
        <div id="Compiled">

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

CSS:

```<code>h1 {
font-size: 25px
}
#Code {
border: 5px solid black;
font-family: Arial, Helvetica, sans-serif;
font-weight: bolder;
height: 200px;
width: 400px;
overflow: hidden;
text-align: left;
color: black;
}
body {
background-color: white;
color: black;
font-size: 25px;
}
.dark-mode {
background-color: black;
color: white;
}
button {
background-color: white;
border: 5px solid black;
font-weight: bolder;
}
button:hover {
background-color: lightgrey;
}
b {
font-size: 20px;
}
#Compiled {
    border: 5px solid black;
    height: 200px;
    width: 400px;
    background-color: white;
    color: black;
}
textarea {
    max-width: 400px;
    max-height: 200px;
}
</code>```

JS:

```<code>let ClassTagAmount = 0;
let CurrentClassSelected = "none";
let Code = document.getElementById("Code").value;
function Show(code){
    document.getElementById("Compiled").innerHTML = code;
}
function DarkMode() {
    var element = document.body;
    element.classList.toggle("dark-mode");
}
function Compile() {
    ClassTagAmount = 0;
    let Code = document.getElementById("Code").value;
    if (Code.includes("Main Anim[] class=>") == true){
        ClassTagAmount += 1;
    }
    if (Code.includes("<=ClassEnd") == true){
        ClassTagAmount -= 1;
    }
    if (ClassTagAmount == 0){
        console.log(Code)
        console.log(ClassTagAmount)
    }else{
        Show("Syntax Error: Unexpected missing starting or ending class token")
        console.log(ClassTagAmount)
    }
}
</code>```

Whenever I put multiple of the same string, it should count both of the same strings and make the ClassTagAmount variable become -1 or 1 but instead it is 0, when it is only one string it works but with multiple strings it just becomes 0.

EG:
Test A(

Input:

```<code>Main Anim[] class=>

<=ClassEnd
</code>```

Output:

```<code>Main Anim[] class=>

<=ClassEnd
0
</code>```

)

Test B(

Input:

```<code>Main Anim[] class=>
</code>```

Output:

```<code>Syntax Error: Unexpected missing starting or ending class token
1
</code>```

)

but...

Test C(

Input:

```<code>Main Anim[] class=>
Main Anim[] class=>
<=ClassEnd
</code>```

Error Output:

```<code>Main Anim[] class=>
Main Anim[] class=> //this line is being forgotten.
<=ClassEnd
0
</code>```

Expected Output:

```<code>Syntax Error: Unexpected missing starting or ending class token
1
</code>```

)

I was expecting so there is an equal amount of the two tags, Main Anim[] class=> and <=ClassEnd but
when I put these two not equally then the program thinks it is an equal amount, I expected an error as it is not equal to eachother as either there is two start tags and one end tag or one start tag and two end tags, thus is should output 1 and the error but instead it shows 0 as it seemed to skip all other text except of the closest one.

Body:
I am making my own programming language using JS but when I attempt to put multiple words where it is expected to be an error, it has no errors, I don't know why .includes only gets one string and skips the others, could I get any help on the subject??

HTML:

<!DOCTYPE html>

        <title>HyperAnimator</title>

HyperAnimator:

        Dark mode: <button onclick="DarkMode()">Toggle dark mode</button>

        Input code:

        <textarea id="Code">
Main Anim[] class=>

<=ClassEnd</textarea>

        <button onclick="Compile()">Compile</button>

CSS:

h1 {
font-size: 25px
}
#Code {
border: 5px solid black;
font-family: Arial, Helvetica, sans-serif;
font-weight: bolder;
height: 200px;
width: 400px;
overflow: hidden;
text-align: left;
color: black;
}
body {
background-color: white;
color: black;
font-size: 25px;
}
.dark-mode {
background-color: black;
color: white;
}
button {
background-color: white;
border: 5px solid black;
font-weight: bolder;
}
button:hover {
background-color: lightgrey;
}
b {
font-size: 20px;
}
#Compiled {
    border: 5px solid black;
    height: 200px;
    width: 400px;
    background-color: white;
    color: black;
}
textarea {
    max-width: 400px;
    max-height: 200px;
}

JS:

let ClassTagAmount = 0;
let CurrentClassSelected = "none";
let Code = document.getElementById("Code").value;
function Show(code){
    document.getElementById("Compiled").innerHTML = code;
}
function DarkMode() {
    var element = document.body;
    element.classList.toggle("dark-mode");
}
function Compile() {
    ClassTagAmount = 0;
    let Code = document.getElementById("Code").value;
    if (Code.includes("Main Anim[] class=>") == true){
        ClassTagAmount += 1;
    }
    if (Code.includes("<=ClassEnd") == true){
        ClassTagAmount -= 1;
    }
    if (ClassTagAmount == 0){
        console.log(Code)
        console.log(ClassTagAmount)
    }else{
        Show("Syntax Error: Unexpected missing starting or ending class token")
        console.log(ClassTagAmount)
    }
}

Whenever I put multiple of the same string, it should count both of the same strings and make the ClassTagAmount variable become -1 or 1 but instead it is 0, when it is only one string it works but with multiple strings it just becomes 0.

EG:
Test A(

Input:

Main Anim[] class=>

<=ClassEnd

Output:

Main Anim[] class=>

<=ClassEnd
0

)

Test B(

Input:

Main Anim[] class=>

Output:

Syntax Error: Unexpected missing starting or ending class token
1

)

but...

Test C(

Input:

Main Anim[] class=>
Main Anim[] class=>
<=ClassEnd

Error Output:

Main Anim[] class=>
Main Anim[] class=> //this line is being forgotten.
<=ClassEnd
0

Expected Output:

Syntax Error: Unexpected missing starting or ending class token
1

)

I was expecting so there is an equal amount of the two tags, Main Anim[] class=> and <=ClassEnd but
when I put these two not equally then the program thinks it is an equal amount, I expected an error as it is not equal to eachother as either there is two start tags and one end tag or one start tag and two end tags, thus is should output 1 and the error but instead it shows 0 as it seemed to skip all other text except of the closest one.


问:
Yahoo Finance Request Returns Sunday Data
The following code returns information as I expected. But the dates returned are sometimes Monday-Friday and othertimes Sunday-Thursday. Why is this? How can I get it to be concistent?

I'm In Australia (GMT + 10 hours) and I'm querying stocks on the Australian exchange.

```<code>import datetime as dt
import pandas as pd
from pandas_datareader import data as pdr
years = [2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021]
for year in years:
  end = dt.date(year, 12, 31)
  start = dt.date(year, 1, 1)

  stocklist = ['AD8', 'ANZ', 'AFI']
  stocks = [i + '.AX' for i in stocklist]

  df = pdr.get_data_yahoo(stocks, start, end, interval = 'd')
  print(df.head())
</code>```

I was expecting all data to be Monday to Friday with no data for days on which the market was closed.

Body:
The following code returns information as I expected. But the dates returned are sometimes Monday-Friday and othertimes Sunday-Thursday. Why is this? How can I get it to be concistent?

I'm In Australia (GMT + 10 hours) and I'm querying stocks on the Australian exchange.

import datetime as dt
import pandas as pd
from pandas_datareader import data as pdr
years = [2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021]
for year in years:
  end = dt.date(year, 12, 31)
  start = dt.date(year, 1, 1)

  stocklist = ['AD8', 'ANZ', 'AFI']
  stocks = [i + '.AX' for i in stocklist]

  df = pdr.get_data_yahoo(stocks, start, end, interval = 'd')
  print(df.head())

I was expecting all data to be Monday to Friday with no data for days on which the market was closed.


问:
Setup SonarCloud with Github Action
I want to use SonarCloud to verify my CodeCoverage on GitHub, but there is a project stored together in my Repo. Two projects, each of which uses different tools (Swift and Java) for development.

I want to only check Swift Project,Here is the error I got.

```<code>INFO: Load metrics repository
INFO: Load metrics repository (done) | time=532ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 44.335s
INFO: Final Memory: 30M/107M
ERROR: Error during SonarScanner execution
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.
INFO: ------------------------------------------------------------------------
    at org.sonar.java.classpath.ClasspathForMain.init(ClasspathForMain.java:75)
    at org.sonar.java.classpath.AbstractClasspath.getElements(AbstractClasspath.java:319)
    at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:205)
    at org.sonar.java.JavaFrontend.<init>(JavaFrontend.java:97)
    at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:112)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:468)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:464)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:420)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:130)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
    at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Error: Process completed with exit code 1.
</code>```

This is my setting.

sonar-project.properties

```<code>sonar.projectKey=myproject.mobile.workspace
sonar.organization=myproject

sonar.exclusions=Myproject/iOS/**
sonar.test.exclusions=Myproject/iOS/**
sonar.test=Myproject/iOS/

sonar.cfamily.cache.enabled=true
sonar.cfamily.cache.path=relative_or_absolute_path_to_cache_location
</code>```

build.yml

```<code>name: Myproject-iOS-Sonar-Cloud-Code-Coverage-Report
on: [pull_request]
jobs:
  build:
    name: Build and analyze
    runs-on: macos-latest
    env:
      BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Install sonar-scanner and build-wrapper
        uses: SonarSource/sonarcloud-github-c-cpp@v1
      - name: Run build-weapper
        run: |
          build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
          xcodebuild test \
          -workspace Myproject/iOS/Myproject.xcworkspace \
          -scheme MyprojectTests \
          -destination 'platform=iOS Simulator,name=iPhone 11,OS=15.2' \
          -enableCodeCoverage YES \
          -showBuildSettings build test
      - name: Run sonar-scanner
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: |
          sonar-scanner \
          --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
</code>```

I want SonarClond to check only the swift project.

Title: Setup SonarCloud with Github Action

Body:
I want to use SonarCloud to verify my CodeCoverage on GitHub, but there is a project stored together in my Repo. Two projects, each of which uses different tools (Swift and Java) for development.

I want to only check Swift Project,Here is the error I got.

INFO: Load metrics repository
INFO: Load metrics repository (done) | time=532ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 44.335s
INFO: Final Memory: 30M/107M
ERROR: Error during SonarScanner execution
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.
INFO: ------------------------------------------------------------------------
    at org.sonar.java.classpath.ClasspathForMain.init(ClasspathForMain.java:75)
    at org.sonar.java.classpath.AbstractClasspath.getElements(AbstractClasspath.java:319)
    at org.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:205)
    at org.sonar.java.JavaFrontend.<init>(JavaFrontend.java:97)
    at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:112)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:468)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:464)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:420)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:130)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
    at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Error: Process completed with exit code 1.

This is my setting.

sonar-project.properties

sonar.projectKey=myproject.mobile.workspace
sonar.organization=myproject

sonar.exclusions=Myproject/iOS/**
sonar.test.exclusions=Myproject/iOS/**
sonar.test=Myproject/iOS/

sonar.cfamily.cache.enabled=true
sonar.cfamily.cache.path=relative_or_absolute_path_to_cache_location

build.yml

name: Myproject-iOS-Sonar-Cloud-Code-Coverage-Report
on: [pull_request]
jobs:
  build:
    name: Build and analyze
    runs-on: macos-latest
    env:
      BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Install sonar-scanner and build-wrapper
        uses: SonarSource/sonarcloud-github-c-cpp@v1
      - name: Run build-weapper
        run: |
          build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \
          xcodebuild test \
          -workspace Myproject/iOS/Myproject.xcworkspace \
          -scheme MyprojectTests \
          -destination 'platform=iOS Simulator,name=iPhone 11,OS=15.2' \
          -enableCodeCoverage YES \
          -showBuildSettings build test
      - name: Run sonar-scanner
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: |
          sonar-scanner \
          --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"

I want SonarClond to check only the swift project.


问:
INSTR command in Doctrine querybuilder
I am currently working with php and using doctrine.
I have this query that I want to rewrite by using the querybuilder so I can make use of it in my graphql command.
It selects a string field that is compared with a like statement.
All fine and good however I want it to order by the most exact and shortest match.
The query I am converting uses an INSTR command for it and I haven't got the faintest idea how to convert it to this querybuilder thing.

I have found this library that kinda does the trick but it is all weird and not updated or contributed to for a long time so not really reliable.

Does anyone have an idea how I should approach this conversion?

The query I am converting sorta looks like this:

```<code>SELECT field
FROM table
WHERE field like '%4321%'
ORDER BY INSTR(field, '4321') ASC, LENGTH(field) ASC, field ASC
</code>```

Title: INSTR command in Doctrine querybuilder

Body:
I am currently working with php and using doctrine.
I have this query that I want to rewrite by using the querybuilder so I can make use of it in my graphql command.
It selects a string field that is compared with a like statement.
All fine and good however I want it to order by the most exact and shortest match.
The query I am converting uses an INSTR command for it and I haven't got the faintest idea how to convert it to this querybuilder thing.

I have found this library that kinda does the trick but it is all weird and not updated or contributed to for a long time so not really reliable.

Does anyone have an idea how I should approach this conversion?

The query I am converting sorta looks like this:

SELECT field
FROM table
WHERE field like '%4321%'
ORDER BY INSTR(field, '4321') ASC, LENGTH(field) ASC, field ASC


问:
How to write url pattern for login() with an template name argument in django4
TypeError at /users/login/
login() got an unexpected keyword argument 'template_name'

```<code>from django.contrib.auth import login
from django.urls import path

from . import views

app_name = 'users'
urlpatterns = [
    # Login page
    path('login/', login, {'template_name': 'login.html'}, name='login'),

    # Registering page
    path('register/', views.register, name='register'),
]
</code>```

I tried this url pattern but it gives me TypeError...
Any other way of passing template name in django login() function url pattern

Body:
TypeError at /users/login/
login() got an unexpected keyword argument 'template_name'

from django.contrib.auth import login
from django.urls import path

from . import views

app_name = 'users'
urlpatterns = [
    # Login page
    path('login/', login, {'template_name': 'login.html'}, name='login'),

    # Registering page
    path('register/', views.register, name='register'),
]

I tried this url pattern but it gives me TypeError...
Any other way of passing template name in django login() function url pattern


问:
Salesforce OAuth 2.0 flow using Connected app redirects to the home page of the org
I have implemented the OAuth 2.0 flow using the Connected app in one of my applications. It works fine for most of the Salesforce orgs except one which takes me to that org's home page instead of returning tokens and redirecting me to my callback page in the application.

It's very weird because it has never happened before and couldn't find anything on the Internet too regarding this behaviour.

Any help or suggestion would be appreciated.

Thanks in advance.


问:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am getting a linking error with my two C++ files as seen below.
Compile error

It compiles up to the point of two object files then fails on linking.

Below is my code, I commented out most of main in order to isolate the issue.

I am using the boost/JSON library. The duplicates are all from the boost JSON library.

The JSONParser file is going to take in a JSON object and turn it to a C++ object but I don't think anything to do with the actual code is the issue. Just either a library or header file issue.

main.cpp

```<code>#include "JSONParser.hpp"
/*
#include <boost/beast/core.hpp>
#include <boost/beast.hpp>
#include <boost/beast/ssl.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <iostream>
#include <string>
#include <thread>

namespace net = boost::asio;
namespace beast = boost::beast;
using namespace boost::beast;
using namespace boost::beast::websocket;

*/

int main (void) {

  //net::io_context ioc;
  //tcp_stream sock(ioc);
  //net::ssl::context ctx(net::ssl::context::tlsv12);

}
</code>```

JSONParser.hpp

```<code>
#ifndef JSONPARSER_H
#define JSONPARSER_H

#define BOOST_JSON_STACK_BUFFER_SIZE 1024
#include <boost/json/src.hpp>

class candlestick{
    private:
        double openPrice;
        double closePrice;
        double priceHigh;
        double priceLow;
        double baseVolume;
        double quoteVolume;
        bool isClosed;

    public:
        candlestick (double oP, double cP, double pH, double pL, double bV, double qV, bool iC);

        void setopenPrice(double p) {
            openPrice = p;
        }
        double getopenPrice(void) {
            return openPrice;
        }
        void setclosePrice(double p) {
            closePrice = p;
        }
        double getclosePrice(void) {
            return closePrice;
        }
        void setpriceHigh(double p) {
            priceHigh = p;
        }
        double getpriceHigh(void) {
            return priceHigh;
        }
        void setpriceLow(double p) {
            priceLow = p;
        }
        double getpriceLow(void) {
            return priceLow;
        }
        void setbaseVolume(double v) {
            baseVolume = v;
        }
        double getbaseVolume(void) {
            return baseVolume;
        }
        void setquoteVolume(double v) {
            quoteVolume = v;
        }
        double getquoteVolume(void) {
            return quoteVolume;
        }
        void setClosed(bool c) {
            isClosed = c;
        }
        bool getClosed(void) {
            return isClosed;
        }
};

candlestick::candlestick (double oP, double cP, double pH, double pL, double bV, double qV, bool iC) {
        openPrice = oP;
        closePrice = cP;
        priceHigh = pH;
        priceLow = pL;
        baseVolume = bV;
        quoteVolume = qV;
        isClosed = iC;
};

candlestick createCandlestickObject ();

#endif
</code>```

JSONParser.cpp

```<code>#include "JSONParser.hpp"
#include <iostream>
#include <sstream>
#include <string>

candlestick createCandlestickObject () {
    candlestick c (2, 2, 2, 2, 2, 2, true);

    return c;
}

</code>```

By commenting out the #include "JSONParser.hpp" out of main, I was able to remove the error, therefore definitely a linking issue.

Body:
I am getting a linking error with my two C++ files as seen below.
Compile error

It compiles up to the point of two object files then fails on linking.

Below is my code, I commented out most of main in order to isolate the issue.

I am using the boost/JSON library. The duplicates are all from the boost JSON library.

The JSONParser file is going to take in a JSON object and turn it to a C++ object but I don't think anything to do with the actual code is the issue. Just either a library or header file issue.

main.cpp

#include "JSONParser.hpp"
/*
#include <boost/beast/core.hpp>
#include <boost/beast.hpp>
#include <boost/beast/ssl.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <iostream>
#include <string>
#include <thread>

namespace net = boost::asio;
namespace beast = boost::beast;
using namespace boost::beast;
using namespace boost::beast::websocket;

*/

int main (void) {

  //net::io_context ioc;
  //tcp_stream sock(ioc);
  //net::ssl::context ctx(net::ssl::context::tlsv12);

}

JSONParser.hpp

#ifndef JSONPARSER_H
#define JSONPARSER_H

#define BOOST_JSON_STACK_BUFFER_SIZE 1024
#include <boost/json/src.hpp>

class candlestick{
    private:
        double openPrice;
        double closePrice;
        double priceHigh;
        double priceLow;
        double baseVolume;
        double quoteVolume;
        bool isClosed;

    public:
        candlestick (double oP, double cP, double pH, double pL, double bV, double qV, bool iC);

        void setopenPrice(double p) {
            openPrice = p;
        }
        double getopenPrice(void) {
            return openPrice;
        }
        void setclosePrice(double p) {
            closePrice = p;
        }
        double getclosePrice(void) {
            return closePrice;
        }
        void setpriceHigh(double p) {
            priceHigh = p;
        }
        double getpriceHigh(void) {
            return priceHigh;
        }
        void setpriceLow(double p) {
            priceLow = p;
        }
        double getpriceLow(void) {
            return priceLow;
        }
        void setbaseVolume(double v) {
            baseVolume = v;
        }
        double getbaseVolume(void) {
            return baseVolume;
        }
        void setquoteVolume(double v) {
            quoteVolume = v;
        }
        double getquoteVolume(void) {
            return quoteVolume;
        }
        void setClosed(bool c) {
            isClosed = c;
        }
        bool getClosed(void) {
            return isClosed;
        }
};

candlestick::candlestick (double oP, double cP, double pH, double pL, double bV, double qV, bool iC) {
        openPrice = oP;
        closePrice = cP;
        priceHigh = pH;
        priceLow = pL;
        baseVolume = bV;
        quoteVolume = qV;
        isClosed = iC;
};

candlestick createCandlestickObject ();

#endif

JSONParser.cpp

#include "JSONParser.hpp"
#include <iostream>
#include <sstream>
#include <string>

candlestick createCandlestickObject () {
    candlestick c (2, 2, 2, 2, 2, 2, true);

    return c;
}

By commenting out the #include "JSONParser.hpp" out of main, I was able to remove the error, therefore definitely a linking issue.


问:
How to tell javascript to identify all html elements on window load?
In my example Iam looking for a way to identify a p element on window load:

The below shown code snippet gives the following error:

Uncaught TypeError: Cannot set properties of null (setting 'innerHTML');

=> I guess thats because on window the load the p element cannot be identified by the getelementid method. Thats because the javascript runs at first.

// example 1

Iam the preset text content.

```
<hr />
<p>So I tried the following to get closer:</p>
<ul>
<li>Browser runs first through the code, but does not execute the changeText() function</li>
<li>Triggering the changeText() function afterwards works fine.
=> The getElementById method can work on the p element because its known at that time</li>
</ul>
<pre class="lang-js prettyprint-override"><code>//example 2
<script>
   function changeText()
{
      document.getElementById("myInputBox").innerHTML ="Iam the text content after button click.";
   }
</script>

<body>
   <p id="myInputBox">Iam the preset text content.</p>
   <button onclick="changeText()">Click me</button>
</body>
</code>```

Does somebody know how to identify the p element on window load (example 1)?

Body:
In my example Iam looking for a way to identify a p element on window load:

The below shown code snippet gives the following error:

Uncaught TypeError: Cannot set properties of null (setting 'innerHTML');

=> I guess thats because on window the load the p element cannot be identified by the getelementid method. Thats because the javascript runs at first.

// example 1

Iam the preset text content.

So I tried the following to get closer:

Browser runs first through the code, but does not execute the changeText() function

Triggering the changeText() function afterwards works fine.
=> The getElementById method can work on the p element because its known at that time

//example 2

Iam the preset text content.

   <button onclick="changeText()">Click me</button>

Does somebody know how to identify the p element on window load (example 1)?


问:
How to create pop up window in Android Native code?
I am not able to find a way to create a Pop up window in Android NDK. Can someone share some code reference or NDK API reference for creating a pop up window?
I meant in C++ and not java code for pop up window.</p>


问:
Merging the contents of files in particular subfolder of all dependency projects
I would like to create a new string file combining the contents of French localised string files alone. What would be the command to get this.

I was able to retrieve all files with. String extension, but I want to merge contents in particular subfolder of all dependency projects.


问:
Scroll-chain containing to div without property in CSS on mobile
I'm having an issue, primarily on mobile devices (in my case, an iOS device) where a div is seemingly preventing scroll-chaining; this is problematic because it's the first place you would touch to scroll (as opposed to a smaller div above it). Similarly for scrolling back up. I couldn't find anything online stating that there was a parameter or property default to mobile webkit that would contain a div. It seems though maybe this is behavior on iOS webkit, as notably, a second swipe on the final image after the "bounce" of the scroll of the div returns to normal positioning in the div allows a scroll (sometimes seemingly inconsistently?)

I've managed to recreate the issue with a test with minimum code repeated from my project (view on mobile! overscroll works fine on desktop)

https://codepen.io/hennigarj/pen/ZEjYrpW

```<code><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>My Website</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
    <style>
        #container {
            display: block;
            width: 100%;
            height: 100%;
            padding-top: 4vh;
        }
            .flex-items {
                width: 100%;
                overflow: auto;
            }

            .flex-items:nth-child(1) {
                display: block;
                height: 10vh;
            }
            .flex-items:nth-child(2) {
                display: block;
                margin-top: 4vh;
                margin-bottom: 4vh;
                height: 64vh;
                text-align: center;
            }
                .flex-items img {
                    max-width: 100%;
                }
            .flex-items:nth-child(3) {
                display: block;
                padding-bottom: 6vh;
            }
    </style>
  </head>
  <body>
    <div id="container">
        <div class="flex-items">
            Div 1
        </div>
        <div class="flex-items">
            <section id="highlights">
                <div class="highlight">
                    <img src="https://placehold.jp/400x536.png" />
                </div>
                <div class="highlight">
                    <img src="https://placehold.jp/400x536.png" />
                </div>
                <div class="highlight">
                    <img src="https://placehold.jp/400x536.png" />
                </div>
            </section>
        </div>
        <div class="flex-items">
            Div 3
        </div>
    </div>
  </body>
</html>
</code>```

Anyone have any ideas? I've tried all sorts of overflows and overscroll-behaviors on everything but nothing seems to fix this, and there is no value to specifically enable scroll-chaining through overscroll.

This is probably clear as day and I'm completely missing it.

Thank you :)

I've tried various different potential heights, overscroll-behaviors, overflows on divs (to no success). Ideally, hitting the end of the div would continue the scroll-chain past it, just as it does on desktop, but it contains. I've tried -webkit-overflow-scroling: auto as well.

Body:
I'm having an issue, primarily on mobile devices (in my case, an iOS device) where a div is seemingly preventing scroll-chaining; this is problematic because it's the first place you would touch to scroll (as opposed to a smaller div above it). Similarly for scrolling back up. I couldn't find anything online stating that there was a parameter or property default to mobile webkit that would contain a div. It seems though maybe this is behavior on iOS webkit, as notably, a second swipe on the final image after the "bounce" of the scroll of the div returns to normal positioning in the div allows a scroll (sometimes seemingly inconsistently?)

I've managed to recreate the issue with a test with minimum code repeated from my project (view on mobile! overscroll works fine on desktop)

https://codepen.io/hennigarj/pen/ZEjYrpW

<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>My Website</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />

            Div 1

            Div 3

Anyone have any ideas? I've tried all sorts of overflows and overscroll-behaviors on everything but nothing seems to fix this, and there is no value to specifically enable scroll-chaining through overscroll.

This is probably clear as day and I'm completely missing it.

Thank you :)

I've tried various different potential heights, overscroll-behaviors, overflows on divs (to no success). Ideally, hitting the end of the div would continue the scroll-chain past it, just as it does on desktop, but it contains. I've tried -webkit-overflow-scroling: auto as well.


问:
Submit Button disabled if file doesn't upload in Django
Currently working on a Django project where I am stuck in a situation and the scenario is something like that I have two forms in my abc.html page, one is used for input file and second is used to run python script internally. But the issue is even if I don't input the file the submit button "run python script" start's working without submitting a file. Here I want to create a check that submit button "run python script" will run only at one condition when file will submitted otherwise button will disable. It will active only at one condition when user will input the file.
I am sharing the details:

abc.html:

```<code><!--form to input file -->
<form method="post" enctype="multipart/form-data" name="myform">
      {% csrf_token %}

<input type="file" id="file" name="doc" class="inputfile" onchange="document.myform.submit()">                 </form>
                          <-- end of input file-->

 <!-- form to run python script -->
<form action = "/results/" method="post" id="subform">
     {% csrf_token %}
<input type="submit" id="btnSubmit" name="doc" value="run python script" class="btn btn-warning btn-sm" />
 </form>
                    <-- end of form running python script -->
</code>```

views.py:

def compliance_check(request):              #function to upload file
  global uploaded_file
  if request.method == 'POST':
    uploaded_file = request.FILES['doc']
    print(uploaded_file.name)
    print(uploaded_file.size)
    fs = FileSystemStorage()
    fs.save(uploaded_file.name, uploaded_file)
    messages.info(request, 'your file ' + uploaded_file.name + " has been uploaded successfully")
  return render(request, 'enroll/abc.html')

def results(request):                       #function to run python script
  user_id = request.session['user_id']

  hash_id, id_exists = compliance(user_id)
  request.session['hash_id'] = hash_id

  if id_exists:
    messages.info(request, "This File has already been analyzed")

  return redirect(tables_view)

```

I have tried multiple ways to create a check but not succeed yet. I hope that everyone will understand the question and the scenario is simple that there should be a check before clicking on run script button that please select the file first. The button should run only at one condition if user upload file.

Body:
Currently working on a Django project where I am stuck in a situation and the scenario is something like that I have two forms in my abc.html page, one is used for input file and second is used to run python script internally. But the issue is even if I don't input the file the submit button "run python script" start's working without submitting a file. Here I want to create a check that submit button "run python script" will run only at one condition when file will submitted otherwise button will disable. It will active only at one condition when user will input the file.
I am sharing the details:

abc.html:

<form method="post" enctype="multipart/form-data" name="myform">
      {% csrf_token %}

<input type="file" id="file" name="doc" class="inputfile" onchange="document.myform.submit()">                 </form>
                          <-- end of input file-->

<form action = "/results/" method="post" id="subform">
     {% csrf_token %}
<input type="submit" id="btnSubmit" name="doc" value="run python script" class="btn btn-warning btn-sm" />
 </form>
                    <-- end of form running python script -->

views.py:

def compliance_check(request):              #function to upload file
  global uploaded_file
  if request.method == 'POST':
    uploaded_file = request.FILES['doc']
    print(uploaded_file.name)
    print(uploaded_file.size)
    fs = FileSystemStorage()
    fs.save(uploaded_file.name, uploaded_file)
    messages.info(request, 'your file ' + uploaded_file.name + " has been uploaded successfully")
  return render(request, 'enroll/abc.html')

def results(request):                       #function to run python script
  user_id = request.session['user_id']

  hash_id, id_exists = compliance(user_id)
  request.session['hash_id'] = hash_id

  if id_exists:
    messages.info(request, "This File has already been analyzed")

  return redirect(tables_view)

I have tried multiple ways to create a check but not succeed yet. I hope that everyone will understand the question and the scenario is simple that there should be a check before clicking on run script button that please select the file first. The button should run only at one condition if user upload file.