问:
PHP PDO MSSQL - Aborting DB transaction in query which raisses error with severity 0 (warnings)
I am creating web app in Laravel which connects to MSSQL DB (using PDO) and i'm stuck with a issue when running query (UPDATE in my case)

```<code>update dba.[vl_zahlavi] set [xcmd] = '  AFTERCOMMIT', [vl_zahlavi].[ts] = '2023-01-10 14:16:06.505' where [doklad] = '23VLTU0100000001'
</code>```

which raises error with severity 0 within update trigger (used for sending progress bar information to client). Trigger is created within information system, so I'm not able to disable this functionality.

```<code>select @progress_count = convert(int/*BY*/,@akt_pocet), @progress_current = 0, @progress_dt_o_skl_o_skl_gen_poh_prub = DateAdd(ms, -1000, GetDate())
select @progress_arg = '#SQL_PROGRESS=O_SKL,O_SKL_GEN_POH_PRUB,' + convert(varchar(255)/*BY*/, @@nestlevel) + ',OPEN,' + convert(varchar(255)/*BY*/, @progress_count) + ';'
RAISERROR ('%s', 0, 1, @progress_arg) WITH NOWAIT
</code>```

Problem is, that PHP client send abort and transaction is automatically rolled back. When I comment this section of code (or change severity to 16), everything works as expected. Bellow is printscreen from SQL server profiler.

printscreen

Is PDO able to catch user error messages?

Thank you in advance.

I have tried to change DB sets and PDO options, but without success.

Body:
I am creating web app in Laravel which connects to MSSQL DB (using PDO) and i'm stuck with a issue when running query (UPDATE in my case)

update dba.[vl_zahlavi] set [xcmd] = '  AFTERCOMMIT', [vl_zahlavi].[ts] = '2023-01-10 14:16:06.505' where [doklad] = '23VLTU0100000001'

which raises error with severity 0 within update trigger (used for sending progress bar information to client). Trigger is created within information system, so I'm not able to disable this functionality.

select @progress_count = convert(int/*BY*/,@akt_pocet), @progress_current = 0, @progress_dt_o_skl_o_skl_gen_poh_prub = DateAdd(ms, -1000, GetDate())
select @progress_arg = '#SQL_PROGRESS=O_SKL,O_SKL_GEN_POH_PRUB,' + convert(varchar(255)/*BY*/, @@nestlevel) + ',OPEN,' + convert(varchar(255)/*BY*/, @progress_count) + ';'
RAISERROR ('%s', 0, 1, @progress_arg) WITH NOWAIT

Problem is, that PHP client send abort and transaction is automatically rolled back. When I comment this section of code (or change severity to 16), everything works as expected. Bellow is printscreen from SQL server profiler.

printscreen

Is PDO able to catch user error messages?

Thank you in advance.

I have tried to change DB sets and PDO options, but without success.


来源: stackexchange

问:
how to check if an Isolate is killed?
The Isolate class (https://api.dart.dev/stable/2.18.6/dart-isolate/Isolate-class.html) doesn't seem to have any properties indicating if it has been killed.</p>

ContentLicense: CC BY-SA 4.0

Title: how to check if an Isolate is killed?


问:
Application on SAP Cloud Foundry - OAuth 2.0 - Error: Something went amiss
I have been delevopping and deploying a python application for the SAP Cloud Foundry and trying to implement an authentication check using OAuth2.0.

Using this Tutorial.
Link to Code Note: I excluded the node_modules/@sap/approuter for storage reasons

When I open https://cproPythonAI_web.cfapps.us10.hana.ondemand.com the login site is loaded correctly, but after the login I get to a Error-Site.

Kind regards and thanks for help
Nick

did every step of the tutorial

entered "authenticationMethod": "none" to the xs-app.json. Then i get redirect to the index.html, but of course the authentification is skipped


问:
calculate total number after retrieving subtotal of each item within a query with SQL Server
I have 2 tables tbl_order which is the parent of tbl_order_product: each product in tbl_order_product has its own quantity, price, and discount that is important to count as the total price, also each order has its own discount to, I want to make a query that gets the total price of each order which needs to calculate the total price of each product inside that order, then sum them up and calculate it with the discount of the order itself, I was able to achieve this with a query which I don't think is an efficient way like this:

```<code>select o.id, count(op.id) as productsCount,

--calculating the total price
sum(op.price * op.quantity - op.price * op.quantity * op.discount / 100) -
sum(op.price * op.quantity - op.price * op.quantity * op.discount / 100) * o.discount / 100 as total

from tbl_order as o
inner join tbl_payment_type as pt on o.payment_type_id = pt.id
inner join tbl_customer as c on o.customer_id = c.id
inner join tbl_order_product as op on o.id = op.order_id
inner join tbl_user as u on o.created_by = u.id
group by o.id, o.discount
</code>```

I believe there could be a better to achieve the same thing which i don't know how

tbl_order:

tbl_order_product:

result of my query:

Body:
I have 2 tables tbl_order which is the parent of tbl_order_product: each product in tbl_order_product has its own quantity, price, and discount that is important to count as the total price, also each order has its own discount to, I want to make a query that gets the total price of each order which needs to calculate the total price of each product inside that order, then sum them up and calculate it with the discount of the order itself, I was able to achieve this with a query which I don't think is an efficient way like this:

select o.id, count(op.id) as productsCount,

--calculating the total price
sum(op.price * op.quantity - op.price * op.quantity * op.discount / 100) -
sum(op.price * op.quantity - op.price * op.quantity * op.discount / 100) * o.discount / 100 as total

from tbl_order as o
inner join tbl_payment_type as pt on o.payment_type_id = pt.id
inner join tbl_customer as c on o.customer_id = c.id
inner join tbl_order_product as op on o.id = op.order_id
inner join tbl_user as u on o.created_by = u.id
group by o.id, o.discount

I believe there could be a better to achieve the same thing which i don't know how

tbl_order:

tbl_order_product:

result of my query:


问:
I need create custom order tracking functionality in woo commerce
Hello I have a woo commerce website and I  am selling some books every thing is cleared but I need create custom order tracking functionality in woo commerce code to add order tracking functionality for end user is it possible if possible how can I do this please help me.

I create a custom page name as woocommerce-custom-order-tracking.php

and code is given below

```<code><?php

// Register a custom endpoint to handle order tracking
function wc_register_order_tracking_endpoint() {
    add_rewrite_endpoint( 'order-tracking', EP_PAGES );
}
add_action( 'init', 'wc_register_order_tracking_endpoint' );

// Display the order tracking form
function wc_display_order_tracking_form() {
    if ( ! is_wc_endpoint_url( 'order-tracking' ) ) {
        return;
    }

    // Get the order id from the query string
    $order_id = absint( $_GET['order_id'] );

    // Get the order
    $order = wc_get_order( $order_id );

    if ( $order ) {
        // Display the order tracking information
        echo '<p>Order Number: ' . $order->get_order_number() . '</p>';
        echo '<p>Order Status: ' . wc_get_order_status_name( $order->get_status() ) . '</p>';
        echo '<p>Tracking Number: ' . get_post_meta( $order_id, '_tracking_number', true ) . '</p>';
    } else {
        echo '<p>Invalid order ID.</p>';
    }
}
add_action( 'woocommerce_before_single_product', 'wc_display_order_tracking_form' );
</code>```

Body:
Hello I have a woo commerce website and I  am selling some books every thing is cleared but I need create custom order tracking functionality in woo commerce code to add order tracking functionality for end user is it possible if possible how can I do this please help me.

I create a custom page name as woocommerce-custom-order-tracking.php

and code is given below

<?php

// Register a custom endpoint to handle order tracking
function wc_register_order_tracking_endpoint() {
    add_rewrite_endpoint( 'order-tracking', EP_PAGES );
}
add_action( 'init', 'wc_register_order_tracking_endpoint' );

// Display the order tracking form
function wc_display_order_tracking_form() {
    if ( ! is_wc_endpoint_url( 'order-tracking' ) ) {
        return;
    }

    // Get the order id from the query string
    $order_id = absint( $_GET['order_id'] );

    // Get the order
    $order = wc_get_order( $order_id );

    if ( $order ) {
        // Display the order tracking information
        echo '
Order Number: ' . $order->get_order_number() . '
';
        echo '
Order Status: ' . wc_get_order_status_name( $order->get_status() ) . '
';
        echo '
Tracking Number: ' . get_post_meta( $order_id, '_tracking_number', true ) . '
';
    } else {
        echo '
Invalid order ID.
';
    }
}
add_action( 'woocommerce_before_single_product', 'wc_display_order_tracking_form' );


问:
Optimal way data set columns from multple tables in mysql
i am trying to fine tune a query which runs on application dashboard.

Query is like i have a master table & few transaction tables. I have to make some calculation on transataion table & showcase same output along  with few columns from the master table.

I tried with join that worked but query is not fast enough for application ( 40Sec for 1k Records).

I am trying with sub query but maybe i am making mistake somewhere.

sharing dummy details below.

Master  table :

id
name

1
Cell1

2
Cell2

3
Cell3

4
Cell4

transaction table 1 Session1

```<code>| id  | TotalMarks |
| 1   | 21   |
| 1   | 21   |
| 2   | 23   |
| 3   | 24   |
</code>```

Transaction table 2 Session2

```<code>| id  | TotalMarks |
| 1   | 22   |
| 2   | 28   |
| 4   | 25   |
| 4   | 29   |
</code>```

Result i want Like

```<code>| id  | Name | ObtainMarksSession1 | totalObtainMarkSession2 |
| 1   | cell1 |

               |                         |
</code>```

I have checked indexes already but anyway index won't help as i am using aggregate function.

join query

```<code>Select m.id,m.name,sum(s1.TotalMarks) ObtainMarksSession1, sum(s1.TotalMarks) ObtainMarksSession2
from master join session1 s1 on m.id=s1.id and s1.id is not null
join session2 s2 on m.id=s2.id and s2.id is not null
group by m.id,m.name;
</code>```

subquery Sample

```<code>Select id, sum(TotalMarks) ObtainMarksSession1 from session1 where id is not null;
</code>```

Same way i got result from other table also but now i am unable to merge both output. these single query output are very fast.

Need to know how to merge result & get output with name as well from master. also, other suggestion if i can try some other method to make this query fast.

P.s Id is not primary key in transaction table so there might be possiblity for null values.

Body:
i am trying to fine tune a query which runs on application dashboard.

Query is like i have a master table & few transaction tables. I have to make some calculation on transataion table & showcase same output along  with few columns from the master table.

I tried with join that worked but query is not fast enough for application ( 40Sec for 1k Records).

I am trying with sub query but maybe i am making mistake somewhere.

sharing dummy details below.

Master  table :

id
name

1
Cell1

2
Cell2

3
Cell3

4
Cell4

transaction table 1 Session1

| id  | TotalMarks |
| 1   | 21   |
| 1   | 21   |
| 2   | 23   |
| 3   | 24   |

Transaction table 2 Session2

| id  | TotalMarks |
| 1   | 22   |
| 2   | 28   |
| 4   | 25   |
| 4   | 29   |

Result i want Like

| id  | Name | ObtainMarksSession1 | totalObtainMarkSession2 |
| 1   | cell1 |

               |                         |

I have checked indexes already but anyway index won't help as i am using aggregate function.

join query

Select m.id,m.name,sum(s1.TotalMarks) ObtainMarksSession1, sum(s1.TotalMarks) ObtainMarksSession2
from master join session1 s1 on m.id=s1.id and s1.id is not null
join session2 s2 on m.id=s2.id and s2.id is not null
group by m.id,m.name;

subquery Sample

Select id, sum(TotalMarks) ObtainMarksSession1 from session1 where id is not null;

Same way i got result from other table also but now i am unable to merge both output. these single query output are very fast.

Need to know how to merge result & get output with name as well from master. also, other suggestion if i can try some other method to make this query fast.

P.s Id is not primary key in transaction table so there might be possiblity for null values.


问:
Getting error "An error occurred while communicating with Agent IP-0AXXXX" while running tfs tests on MS visual studio test controller
I am running automation tests through azure pipeline using MS VS test agents(configured on aws machines) and VS test controller(set up on an aws server), since last 2 months we intermittently started getting "An error occurred while communicating with Agent IP-0AXXXX" during the runs and whole run fails.

On test controller logs, the message at the time of error:-

"AT-CONTROLLER2\QTController.exe, ControllerObject.ConnectAgent: Agent 'IP-0AXXXX' connected but it was already marked as connected and was allocated. Marking the agent offline first to exclude it from the test run."

Can anyone suggest the reason for this error.

Enabled verbosity(4) logs for test controller.


问:
How to make column in select query from the row of the another select query
i need to convert sub query rows data to columns of the main query
i trying to make report to show monthly sales of item

month           itemid  qyt     amount
Aug-2022    106 576 9993.6
Aug-2022    108 1250    35375
Aug-2022    121 24150   24633
Aug-2022    124 8850    22302
Aug-2022    141 200 20000
Aug-2022    142 4160    120640
Sep-2022    106 2400    9720
```
<pre class="lang-none prettyprint-override"><code>itemid aug-2022-qty aug-2022-amount sep-2022-qty sep-2022-amount
106 576            9993.6        2400         9720
108 1250           35375
121 24150          24633
</code>```

Body:
i need to convert sub query rows data to columns of the main query
i trying to make report to show monthly sales of item

month           itemid  qyt     amount
Aug-2022    106 576 9993.6
Aug-2022    108 1250    35375
Aug-2022    121 24150   24633
Aug-2022    124 8850    22302
Aug-2022    141 200 20000
Aug-2022    142 4160    120640
Sep-2022    106 2400    9720

itemid aug-2022-qty aug-2022-amount sep-2022-qty sep-2022-amount
106 576            9993.6        2400         9720
108 1250           35375
121 24150          24633


问:
error when running cucumber feature file : Error creating bean with name 'myService'

```<code>`Wrote cucumber tests for my project, getting following error when running cucumber feature file. The value for field policyDays is given in my application.yml file In the service class it is defined as follows : @Value("${company.client.policyDays }")
            private Integer policyDays;

Am creating an object of MyService.java (myService) in StepDefinitions.java file.
</code>```

Error log : SEVERE: Exception while executing pickle java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to load ApplicationContext at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:117) at io.cucumber.core.runtime.Runtime.lambda$run$0(Runtime.java:82) at io.cucumber.core.runtime.Runtime.execute(Runtime.java:94) at io.cucumber.core.runtime.Runtime.run(Runtime.java:80) at io.cucumber.core.cli.Main.run(Main.java:87) at io.cucumber.core.cli.Main.main(Main.java:30)
Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at io.cucumber.spring.TestContextAdaptor.<init>(TestContextAdaptor.java:32)
at io.cucumber.spring.SpringFactory.start(SpringFactory.java:152)
at io.cucumber.core.runner.Runner.buildBackendWorlds(Runner.java:134)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:70)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$6(Runtime.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$7(Runtime.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:249)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at io.cucumber.core.runtime.Runtime.lambda$runFeatures$3(Runtime.java:110)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:111)
... 5 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myService': Unsatisfied dependency expressed through field 'policyDays'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:127)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:276)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:244)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 31 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:79)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1339)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
... 50 more
Caused by: java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.valueOf(Integer.java:766)
at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211)
at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)

Tried  @Value("#{company.client.policyDays }") instead of @Value("${company.client.policyDays }"), didn't worked

Body:
`Wrote cucumber tests for my project, getting following error when running cucumber feature file. The value for field policyDays is given in my application.yml file In the service class it is defined as follows : @Value("${company.client.policyDays }")
            private Integer policyDays;

Am creating an object of MyService.java (myService) in StepDefinitions.java file.

Error log : SEVERE: Exception while executing pickle java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to load ApplicationContext at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:117) at io.cucumber.core.runtime.Runtime.lambda$run$0(Runtime.java:82) at io.cucumber.core.runtime.Runtime.execute(Runtime.java:94) at io.cucumber.core.runtime.Runtime.run(Runtime.java:80) at io.cucumber.core.cli.Main.run(Main.java:87) at io.cucumber.core.cli.Main.main(Main.java:30)
Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at io.cucumber.spring.TestContextAdaptor.<init>(TestContextAdaptor.java:32)
at io.cucumber.spring.SpringFactory.start(SpringFactory.java:152)
at io.cucumber.core.runner.Runner.buildBackendWorlds(Runner.java:134)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:70)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$6(Runtime.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$7(Runtime.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:249)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at io.cucumber.core.runtime.Runtime.lambda$runFeatures$3(Runtime.java:110)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:111)
... 5 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myService': Unsatisfied dependency expressed through field 'policyDays'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:127)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:276)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:244)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 31 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:79)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1339)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
... 50 more
Caused by: java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.valueOf(Integer.java:766)
at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211)
at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)

Tried  @Value("#{company.client.policyDays }") instead of @Value("${company.client.policyDays }"), didn't worked


问:
Error handling in MySQL Insert/Update with PHP
I'm trying to come up with a way to control what happends if some UPDATE/INSERTS into a BD fail.

```<code>private $db;
public function __construct() {
    $dsn = 'mysql:dbname=BDNAME;host=localhost';
    $this->db = new PDO($dsn, 'USEER', 'PASSWORD', array('charset' => 'utf8'));
}

public function createnewthingtodo($what,$where,$when,$how,$done){

 $sql= "INSERT INTO TODOLIST (what,where,when,how,done) VALUES (:what, :where, :when, :how, :done)";
    $st = $this->db->prepare ($sql);
    $st->bindValue(':what',$what);
    $st->bindValue(':where',$where);
    $st->bindValue(':when',$when);
    $st->bindValue(':how',$how);
    $st->bindValue(':done',$done);
     if($st->execute()){
        return true;
     }else{
        return false;
     }
    }
</code>```

This example is returning always false, if i delete the last "if" and put the execution part just below the last binvalue, it works just fine, but then i end up with no error handling, any ideas on how can i achieve this? Thanks for your time.

Body:
I'm trying to come up with a way to control what happends if some UPDATE/INSERTS into a BD fail.

private $db;
public function __construct() {
    $dsn = 'mysql:dbname=BDNAME;host=localhost';
    $this->db = new PDO($dsn, 'USEER', 'PASSWORD', array('charset' => 'utf8'));
}

public function createnewthingtodo($what,$where,$when,$how,$done){

 $sql= "INSERT INTO TODOLIST (what,where,when,how,done) VALUES (:what, :where, :when, :how, :done)";
    $st = $this->db->prepare ($sql);
    $st->bindValue(':what',$what);
    $st->bindValue(':where',$where);
    $st->bindValue(':when',$when);
    $st->bindValue(':how',$how);
    $st->bindValue(':done',$done);
     if($st->execute()){
        return true;
     }else{
        return false;
     }
    }

This example is returning always false, if i delete the last "if" and put the execution part just below the last binvalue, it works just fine, but then i end up with no error handling, any ideas on how can i achieve this? Thanks for your time.


问:
How can I send a null element using python requests?
I am trying to send a POST request to an API, which needs a "session" parameter, set to null.
This is the payload sent from my web browser :
{"session":null,"query":{"__type":"SelectListQuery:http://dev.docuware.com/settings/organization"}}

And this is what I'm trying, using the python requests package (return is WIP, and not relevant to the issue):

```<code>    def get_all_fixed_lists_guid(self, s):
        headers = {'Authorization': self.token}
        url = f'{self.url}/DocuWare/Settings/SettingsService.svc/jwt/GetSelectLists'
        payload = {"session": json.dumps(None), "query": {
            "__type": "SelectListQuery:http://dev.docuware.com/settings/organization"}}
        response = s.request('POST', url, json=payload, timeout=30)
        print(response.content)
        return response.status_code == 200
</code>```

URL and token are corrects. From what I read on the subject, I can't send a null parameter using the requests package.

From what I understand, everything I tried sends a string, but an "Element" is expected.
How can I solve it ?

Those are the various thing I tried to send :

None

json.dumps(None)

"null"

False

json.dumps(False)

not passing the parameter at all.

Aside from the last one, this is the error message I get back from the server:

```<code>b'{"ExceptionType":"System.ServiceModel.Dispatcher.NetDispatcherFaultException",
"FaultCode":"Sender","Message":"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http:\\/\\/dev.docuware.com\\/services\\/settings:session.
The InnerException message was \'Expecting state \'Element\'.. Encountered \'Text\'  with name \'\', namespace \'\'. \'.  Please see InnerException for more details.",
"StackTrace":" at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part) at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, PartInfo returnInfo, Object& returnValue) at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeBodyCore(XmlDictionaryReader reader, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)"}'
</code>```

I'm expecting a 200 status code with a json object, instead of the 400 status code and above error.

Body:
I am trying to send a POST request to an API, which needs a "session" parameter, set to null.
This is the payload sent from my web browser :
{"session":null,"query":{"__type":"SelectListQuery:http://dev.docuware.com/settings/organization"}}

And this is what I'm trying, using the python requests package (return is WIP, and not relevant to the issue):

    def get_all_fixed_lists_guid(self, s):
        headers = {'Authorization': self.token}
        url = f'{self.url}/DocuWare/Settings/SettingsService.svc/jwt/GetSelectLists'
        payload = {"session": json.dumps(None), "query": {
            "__type": "SelectListQuery:http://dev.docuware.com/settings/organization"}}
        response = s.request('POST', url, json=payload, timeout=30)
        print(response.content)
        return response.status_code == 200

URL and token are corrects. From what I read on the subject, I can't send a null parameter using the requests package.

From what I understand, everything I tried sends a string, but an "Element" is expected.
How can I solve it ?

Those are the various thing I tried to send :

None

json.dumps(None)

"null"

False

json.dumps(False)

not passing the parameter at all.

Aside from the last one, this is the error message I get back from the server:

b'{"ExceptionType":"System.ServiceModel.Dispatcher.NetDispatcherFaultException",
"FaultCode":"Sender","Message":"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http:\\/\\/dev.docuware.com\\/services\\/settings:session.
The InnerException message was \'Expecting state \'Element\'.. Encountered \'Text\'  with name \'\', namespace \'\'. \'.  Please see InnerException for more details.",
"StackTrace":" at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part) at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, PartInfo returnInfo, Object& returnValue) at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeBodyCore(XmlDictionaryReader reader, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.DataContractJsonSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)"}'

I'm expecting a 200 status code with a json object, instead of the 400 status code and above error.


问:
How to scrape from site with login
Here's the situation: I need to automatize data colecting so my dashboards will run by themselves after done, but for that I need to scrape data from arcgis and I simply can't do it. I don't know how to get html_form() to login right after.

library(tidyverse)
library(rvest)
#>
#> Attaching package: 'rvest'
#> The following object is masked from 'package:readr':
#>
#>     guess_encoding

# login
my_session <- session("https://www.arcgis.com/sharing/oauth2/authorize?client_id=arcgisonline&response_type=code&state=%7B%22portalUrl%22%3A%22https%3A%2F%2Fwww.arcgis.com%22%2C%22uid%22%3A%22lUSoHw3jlAiJ16dMP36PH193qB5Qk_OFbfaJ2UcOlzw%22%2C%22useLandingPage%22%3Atrue%2C%22clientId%22%3A%22arcgisonline%22%7D&expiration=20160&locale=pt-br&redirect_uri=https%3A%2F%2Fwww.arcgis.com%2Fhome%2Faccountswitcher-callback.html&force_login=true&redirectToUserOrgUrl=true&code_challenge=45wD7zc9MLcpgnVlmwcWZ1lp9j4F_cFgeQQK7-4HASU&code_challenge_method=S256&display=default&hideCancel=true&showSignupOption=true&canHandleCrossOrgSignIn=true&signuptype=esri&allow_verification=true")

log_in_form <- html_form(read_html(my_session))[[1]]
#> Error in html_form(read_html(my_session))[[1]]: subscript out of bounds

fill_form <- html_form_set(log_in_form,
                        username = 'MY_USERNAME',
                        password = 'MY_PASSWORD')
#> Error in check_form(form): object 'log_in_form' not found
```

Created on 2023-01-11 with reprex v2.0.2

Title: How to scrape from site with login

Body:
Here's the situation: I need to automatize data colecting so my dashboards will run by themselves after done, but for that I need to scrape data from arcgis and I simply can't do it. I don't know how to get html_form() to login right after.

library(tidyverse)
library(rvest)
#>
#> Attaching package: 'rvest'
#> The following object is masked from 'package:readr':
#>
#>     guess_encoding

# login
my_session <- session("https://www.arcgis.com/sharing/oauth2/authorize?client_id=arcgisonline&response_type=code&state=%7B%22portalUrl%22%3A%22https%3A%2F%2Fwww.arcgis.com%22%2C%22uid%22%3A%22lUSoHw3jlAiJ16dMP36PH193qB5Qk_OFbfaJ2UcOlzw%22%2C%22useLandingPage%22%3Atrue%2C%22clientId%22%3A%22arcgisonline%22%7D&expiration=20160&locale=pt-br&redirect_uri=https%3A%2F%2Fwww.arcgis.com%2Fhome%2Faccountswitcher-callback.html&force_login=true&redirectToUserOrgUrl=true&code_challenge=45wD7zc9MLcpgnVlmwcWZ1lp9j4F_cFgeQQK7-4HASU&code_challenge_method=S256&display=default&hideCancel=true&showSignupOption=true&canHandleCrossOrgSignIn=true&signuptype=esri&allow_verification=true")

log_in_form <- html_form(read_html(my_session))[[1]]
#> Error in html_form(read_html(my_session))[[1]]: subscript out of bounds

fill_form <- html_form_set(log_in_form,
                        username = 'MY_USERNAME',
                        password = 'MY_PASSWORD')
#> Error in check_form(form): object 'log_in_form' not found

Created on 2023-01-11 with reprex v2.0.2


问:
how to insert Image() into docx in JavaScript?
I use "dom-to-image" to convert html table to png:

```<code>var wrapper = document.getElementById('exportContent');
  domtoimage.toSvg(wrapper).then(function (svgDataUrl) {
  downloadPNGFromAnyImageSrc(svgDataUrl);
});

function downloadPNGFromAnyImageSrc(src)
{
  var img = new Image;
  img.onload = function(){
  var canvas = convertImageToCanvas(img);
  var pngImage =  convertCanvasToImage(canvas);
  var anchor = document.createElement('a');
  anchor.setAttribute('href', pngImage.src);
  anchor.setAttribute('download', 'image.png');
  anchor.click();
};

img.src = src;

    // Converts image to canvas; returns new canvas element
function convertImageToCanvas(image) {
      var canvas = document.createElement("canvas");
      canvas.width = image.width;
      canvas.height = image.height;
      canvas.getContext("2d").drawImage(image, 0, 0);
      return canvas;
  }

// Converts canvas to an image
function convertCanvasToImage(canvas) {
    var image = new Image();
    image.src = canvas.toDataURL("image/png", 1.0);
    return image;
  }
}
</code>```

It converts the element to png. However I need to put it into doc file.
Now I need to generate/save a docx file with this png without saving png.

How can I do it?

I followed this post: dom to img

Body:
I use "dom-to-image" to convert html table to png:

var wrapper = document.getElementById('exportContent');
  domtoimage.toSvg(wrapper).then(function (svgDataUrl) {
  downloadPNGFromAnyImageSrc(svgDataUrl);
});

function downloadPNGFromAnyImageSrc(src)
{
  var img = new Image;
  img.onload = function(){
  var canvas = convertImageToCanvas(img);
  var pngImage =  convertCanvasToImage(canvas);
  var anchor = document.createElement('a');
  anchor.setAttribute('href', pngImage.src);
  anchor.setAttribute('download', 'image.png');
  anchor.click();
};

img.src = src;

    // Converts image to canvas; returns new canvas element
function convertImageToCanvas(image) {
      var canvas = document.createElement("canvas");
      canvas.width = image.width;
      canvas.height = image.height;
      canvas.getContext("2d").drawImage(image, 0, 0);
      return canvas;
  }

// Converts canvas to an image
function convertCanvasToImage(canvas) {
    var image = new Image();
    image.src = canvas.toDataURL("image/png", 1.0);
    return image;
  }
}

It converts the element to png. However I need to put it into doc file.
Now I need to generate/save a docx file with this png without saving png.

How can I do it?

I followed this post: dom to img


问:
How can I display the index of a zoo object in a Shiny data table?
I am developing a Shiny app to calculate statistical parameters of ground surface temperature time series in permafrost areas. Short example data can be found here.

Expanding on runExample("09_upload"), I built the upload wizard and would like to display the output as a table so that the user can peruse it before further processing. See code below.

However, I find that although the data is uploaded correctly, only the temperature values are displayed, and not the date/time index. I would like it to be visible as well, otherwise there is no point displaying the data as a table.

Can anyone help me understand what I might have done wrong, or how I can include the index in the datatable display?

Here is my code so far:

```<code>library("xts")
library("shiny")

# Define UI
ui <- fluidPage(
  # App title
  titlePanel("GST Parameters"),

  sidebarLayout(

    # Upload data
    sidebarPanel(

      # Widget title
      h3("Import GST data", align = "center"),

      fileInput("fname", "Choose data file"),
      checkboxInput("header", "Header", value = FALSE),
      radioButtons("separator", "Separator type:",
                   c("Tab"         = "\t",
                     "Comma ,"     = ",",
                     "Semicolon ;" = ";")),
      textInput("skip", "Number of initial rows to skip in data file:",
                value = 0),
      radioButtons("decimal", "Decimal marker:",
                   c("Dot ."   = ".",
                     "Comma ," = ",")),
      textInput("format", "POSIX date-time format:",
                value = "%Y.%m.%d %H:%M:%S")
    ),

    # Display data table
    mainPanel(
      dataTableOutput("contents")
    )
  )
)

server <- function(input, output) {

  # Render data table from uploaded data
  output$contents <- renderDataTable({
    req(input$fname)

    # Read in data as zoo object
    read.delim.zoo(file = input$fname$datapath,
                   sep = input$separator,
                   skip = input$skip,
                   header = input$header,
                   dec = input$decimal,
                   index.column = 1,
                   drop = FALSE,
                   FUN = as.POSIXct,
                   tz = "",
                   format = input$format)
  })

}

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

Thinking this issue might be specific to zoo objects, I also tried xts(read.delim.zoo(...)) and as.data.frame(read.delim.zoo(...)) but it still only displays the temperature values and not the index column.

I am new to Shiny, as I am using it for the first time to adapt my preexisting script for users with little R background. As such, any help is appreciated!

Body:
I am developing a Shiny app to calculate statistical parameters of ground surface temperature time series in permafrost areas. Short example data can be found here.

Expanding on runExample("09_upload"), I built the upload wizard and would like to display the output as a table so that the user can peruse it before further processing. See code below.

However, I find that although the data is uploaded correctly, only the temperature values are displayed, and not the date/time index. I would like it to be visible as well, otherwise there is no point displaying the data as a table.

Can anyone help me understand what I might have done wrong, or how I can include the index in the datatable display?

Here is my code so far:

library("xts")
library("shiny")

# Define UI
ui <- fluidPage(
  # App title
  titlePanel("GST Parameters"),

  sidebarLayout(

    # Upload data
    sidebarPanel(

      # Widget title
      h3("Import GST data", align = "center"),

      fileInput("fname", "Choose data file"),
      checkboxInput("header", "Header", value = FALSE),
      radioButtons("separator", "Separator type:",
                   c("Tab"         = "\t",
                     "Comma ,"     = ",",
                     "Semicolon ;" = ";")),
      textInput("skip", "Number of initial rows to skip in data file:",
                value = 0),
      radioButtons("decimal", "Decimal marker:",
                   c("Dot ."   = ".",
                     "Comma ," = ",")),
      textInput("format", "POSIX date-time format:",
                value = "%Y.%m.%d %H:%M:%S")
    ),

    # Display data table
    mainPanel(
      dataTableOutput("contents")
    )
  )
)

server <- function(input, output) {

  # Render data table from uploaded data
  output$contents <- renderDataTable({
    req(input$fname)

    # Read in data as zoo object
    read.delim.zoo(file = input$fname$datapath,
                   sep = input$separator,
                   skip = input$skip,
                   header = input$header,
                   dec = input$decimal,
                   index.column = 1,
                   drop = FALSE,
                   FUN = as.POSIXct,
                   tz = "",
                   format = input$format)
  })

}

shinyApp(ui, server)

Thinking this issue might be specific to zoo objects, I also tried xts(read.delim.zoo(...)) and as.data.frame(read.delim.zoo(...)) but it still only displays the temperature values and not the index column.

I am new to Shiny, as I am using it for the first time to adapt my preexisting script for users with little R background. As such, any help is appreciated!


问:
Problem with building the test app with detox on android
I ran cd android ; ./gradlew assembleLocalDebug assembleAndroidTest -DtestBuildType=debug ; cd - and it failed because of Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)

Detox version: 20.1.1
React Native version: 0.68.5
Node version: 16.14.0
Device model: Physical Device
Android version: 10
Test-runner (select one): jest

I think it has a conflict between androidx.appcompat version of detox and react-native-track-player. But I don't know how to fix it.

Any help would be appreciated!

Here is the log:

```<code>> Configure project :app
> Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
> Reading env from: .env.local
> Configure project :react-native-firebase_analytics
> :react-native-firebase_analytics package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/analytics/package.json
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_analytics:firebase.bom using default value: 31.1.1
> :react-native-firebase_analytics package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/analytics/package.json
> :react-native-firebase_analytics:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_analytics:android.compileSdk using custom value: 33
> :react-native-firebase_analytics:android.targetSdk using custom value: 33
> :react-native-firebase_analytics:android.minSdk using custom value: 23
> :react-native-firebase_analytics:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_app
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_app:firebase.bom using default value: 31.1.1
> :react-native-firebase_app:play.play-services-auth using default value: 20.3.0
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_app:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_app:android.compileSdk using custom value: 33
> :react-native-firebase_app:android.targetSdk using custom value: 33
> :react-native-firebase_app:android.minSdk using custom value: 23
> :react-native-firebase_app:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_dynamic-links
> :react-native-firebase_dynamic-links package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/dynamic-links/package.json
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_dynamic-links:firebase.bom using default value: 31.1.1
> :react-native-firebase_dynamic-links package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/dynamic-links/package.json
> :react-native-firebase_dynamic-links:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_dynamic-links:android.compileSdk using custom value: 33
> :react-native-firebase_dynamic-links:android.targetSdk using custom value: 33
> :react-native-firebase_dynamic-links:android.minSdk using custom value: 23
> :react-native-firebase_dynamic-links:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_messaging
> :react-native-firebase_messaging package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/messaging/package.json
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_messaging:firebase.bom using default value: 31.1.1
> :react-native-firebase_messaging package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/messaging/package.json
> :react-native-firebase_messaging:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_messaging:android.compileSdk using custom value: 33
> :react-native-firebase_messaging:android.targetSdk using custom value: 33
> :react-native-firebase_messaging:android.minSdk using custom value: 23
> :react-native-firebase_messaging:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-mmkv
> MMKV: node_modules/ found at: /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules
> WARNING:DSL element 'dexOptions' is obsolete and should be removed.
> It will be removed in version 8.0 of the Android Gradle plugin.
> Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.

> Configure project :react-native-reanimated
> AAR for react-native-reanimated has been found
> /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native-reanimated/android/react-native-reanimated-68-hermes.aar
> WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

    This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31

    This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33
    <=============> 100% CONFIGURING [2m 57s]
    WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33s of :app:localDebugRuntimeClass

    This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31

    This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33

> Task :react-native-track-player:checkDebugAndroidTestDuplicateClasses FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':react-native-track-player:checkDebugAndroidTestDuplicateClasses'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.content.res.AppCompatResources$ColorStateListCacheEntry found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$1 found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatedStateListState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatedVectorDrawableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimationDrawableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$FrameInterpolator found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$Transition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$1 found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$BlockInvalidateCallback found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$DrawableContainerState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.StateListDrawable found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.StateListDrawable$StateListState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.DrawableUtils found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.ResourcesWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.TintContextWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.TintInfo found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.TintResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.VectorEnabledTintResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

    * Try:

> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

    You can use '--warning-mode all' to show the individual
</code>```

The test apk should have been built successfully.

Body:
I ran cd android ; ./gradlew assembleLocalDebug assembleAndroidTest -DtestBuildType=debug ; cd - and it failed because of Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)

Detox version: 20.1.1
React Native version: 0.68.5
Node version: 16.14.0
Device model: Physical Device
Android version: 10
Test-runner (select one): jest

I think it has a conflict between androidx.appcompat version of detox and react-native-track-player. But I don't know how to fix it.

Any help would be appreciated!

Here is the log:

> Configure project :app
> Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
> Reading env from: .env.local
> Configure project :react-native-firebase_analytics
> :react-native-firebase_analytics package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/analytics/package.json
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_analytics:firebase.bom using default value: 31.1.1
> :react-native-firebase_analytics package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/analytics/package.json
> :react-native-firebase_analytics:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_analytics:android.compileSdk using custom value: 33
> :react-native-firebase_analytics:android.targetSdk using custom value: 33
> :react-native-firebase_analytics:android.minSdk using custom value: 23
> :react-native-firebase_analytics:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_app
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_app:firebase.bom using default value: 31.1.1
> :react-native-firebase_app:play.play-services-auth using default value: 20.3.0
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_app:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_app:android.compileSdk using custom value: 33
> :react-native-firebase_app:android.targetSdk using custom value: 33
> :react-native-firebase_app:android.minSdk using custom value: 23
> :react-native-firebase_app:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_dynamic-links
> :react-native-firebase_dynamic-links package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/dynamic-links/package.json
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_dynamic-links:firebase.bom using default value: 31.1.1
> :react-native-firebase_dynamic-links package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/dynamic-links/package.json
> :react-native-firebase_dynamic-links:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_dynamic-links:android.compileSdk using custom value: 33
> :react-native-firebase_dynamic-links:android.targetSdk using custom value: 33
> :react-native-firebase_dynamic-links:android.minSdk using custom value: 23
> :react-native-firebase_dynamic-links:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-firebase_messaging
> :react-native-firebase_messaging package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/messaging/package.json
> :react-native-firebase_app package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/app/package.json
> :react-native-firebase_messaging:firebase.bom using default value: 31.1.1
> :react-native-firebase_messaging package.json found at /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/@react-native-firebase/messaging/package.json
> :react-native-firebase_messaging:version set from package.json: 16.5.0 (16,5,0 - 16005000)
> :react-native-firebase_messaging:android.compileSdk using custom value: 33
> :react-native-firebase_messaging:android.targetSdk using custom value: 33
> :react-native-firebase_messaging:android.minSdk using custom value: 23
> :react-native-firebase_messaging:reactNativeAndroidDir /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native/android

> Configure project :react-native-mmkv
> MMKV: node_modules/ found at: /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules
> WARNING:DSL element 'dexOptions' is obsolete and should be removed.
> It will be removed in version 8.0 of the Android Gradle plugin.
> Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.

> Configure project :react-native-reanimated
> AAR for react-native-reanimated has been found
> /Users/alirezahadjar/Dropbox/Mac/Desktop/Projects/ReactNative/omp-mobile-react-native/node_modules/react-native-reanimated/android/react-native-reanimated-68-hermes.aar
> WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33

    This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31

    This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33
    <=============> 100% CONFIGURING [2m 57s]
    WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 33s of :app:localDebugRuntimeClass

    This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31

    This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
    to this project's gradle.properties

    The build will continue, but you are strongly encouraged to update your project to
    use a newer Android Gradle Plugin that has been tested with compileSdk = 33

> Task :react-native-track-player:checkDebugAndroidTestDuplicateClasses FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':react-native-track-player:checkDebugAndroidTestDuplicateClasses'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.content.res.AppCompatResources$ColorStateListCacheEntry found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$1 found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatedStateListState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimatedVectorDrawableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$AnimationDrawableTransition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$FrameInterpolator found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$Transition found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$1 found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$BlockInvalidateCallback found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableContainer$DrawableContainerState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.DrawableWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.StateListDrawable found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.graphics.drawable.StateListDrawable$StateListState found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.DrawableUtils found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.ResourcesWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.TintContextWrapper found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.TintInfo found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.TintResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)
> Duplicate class androidx.appcompat.widget.VectorEnabledTintResources found in modules appcompat-1.0.2-runtime (androidx.appcompat:appcompat:1.0.2) and jetified-appcompat-resources-1.3.1-runtime (androidx.appcompat:appcompat-resources:1.3.1)

     Go to the documentation to learn how to Fix dependency resolution errors.

    * Try:

> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

    You can use '--warning-mode all' to show the individual

The test apk should have been built successfully.


问:
How can I integrate these two codes together
I have this code below. I would like to add an adsense code to it. If I copy my AdSense code between the div tags where it says "ADD DATA HERE", my ad shows but on the very top of the web page and not inside chatbox where I'm trying to insert it. Although if I just change those words ADD DATA HERE to TESTING, the changes reflect and the word testing appears where it should. Obviously I have no idea what I'm doing.

My chatroom filter

```<code>wp.hooks.addFilter('better_messages_messages_list_before', 'custom_action', function(html, thread){
    // Get access to thread data
    // console.log( thread );

    // Add custom html
    html += '<div class="my-custom-html">ADD DATA HERE</div>'
    return html;
});
</code>```

The Google Adsense code that I want to integrate:

```<code><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxxxxx"
     crossorigin="anonymous"></script>
<!-- messenger1 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-xxxxxxxxxxx"
     data-ad-slot="xxxxxxxxxx"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</code>```

Can anyone tell me what I'm doing wrong? Cheers.

I tried the steps I mentioned above

Body:
I have this code below. I would like to add an adsense code to it. If I copy my AdSense code between the div tags where it says "ADD DATA HERE", my ad shows but on the very top of the web page and not inside chatbox where I'm trying to insert it. Although if I just change those words ADD DATA HERE to TESTING, the changes reflect and the word testing appears where it should. Obviously I have no idea what I'm doing.

My chatroom filter

wp.hooks.addFilter('better_messages_messages_list_before', 'custom_action', function(html, thread){
    // Get access to thread data
    // console.log( thread );

    // Add custom html
    html += '
ADD DATA HERE
'
    return html;
});

The Google Adsense code that I want to integrate:

Can anyone tell me what I'm doing wrong? Cheers.

I tried the steps I mentioned above


问:
Handle two branches of an Angular back end on Firebase
I've developed an Angular application. Now everything is ready for release. For the whole back end, I use Google Firebase.

Before I release the app, I want to manage two separate branches: One productive branch and one test branch with another (test) database. I know about Firebase hosting channels, that works.

How can I handle two types of branches within two separate Firebase Back ends? I've tried it with Firebase hosting channels, but then I can't change the back end database. I've tried to create a Firebase Hosting channel, but there I can't handle two different back ends.


问:
Guid should contain 32 digits with 4 dashes in SignalR-Client-Swift
I am new to iOS. I am working on Swift SignalR using SignalR-Client-Swift. Initially it was working fine but now it is returning below error while subscribing channels.

Connection opens successfully

Error on invoke callback

*hubInvocationError(message: "An unexpected error occurred invoking 'Subscribe' on the server. FormatException: Guid should contain 32
digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).")

Go through my code below.

```<code>self.hubConnection.invoke(method: "Subscribe", connectionID, [userID+"_plan", userID+"_notification", userID+"_messaging", userID+"_setting", userID+"_refresh", "4d06546f-f990-40bc-aefe-08b1eb5f7319_messaging"]) { error in
    print("SignalR Workitem Subscribe Error :", error ?? "nil")
}
</code>```

In above code,  is GUID appending with underscored strings(Channels/Subscription), it was working fine initially, but now it stopped. I have google a lot, but couldn't fix this error.

Gone through these links:

https://www.daniweb.com/programming/software-development/threads/274651/guid-should-contain-32-digits-with-4-dashes-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

https://github.com/moozzyk/SignalR-Client-Swift/commits/master/Examples/HubSamplePhone/ViewController.swift

https://github.com/moozzyk/SignalR-Client-Swift/issues

Body:
I am new to iOS. I am working on Swift SignalR using SignalR-Client-Swift. Initially it was working fine but now it is returning below error while subscribing channels.

Connection opens successfully

Error on invoke callback

*hubInvocationError(message: "An unexpected error occurred invoking 'Subscribe' on the server. FormatException: Guid should contain 32
digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).")

Go through my code below.

self.hubConnection.invoke(method: "Subscribe", connectionID, [userID+"_plan", userID+"_notification", userID+"_messaging", userID+"_setting", userID+"_refresh", "4d06546f-f990-40bc-aefe-08b1eb5f7319_messaging"]) { error in
    print("SignalR Workitem Subscribe Error :", error ?? "nil")
}

In above code,  is GUID appending with underscored strings(Channels/Subscription), it was working fine initially, but now it stopped. I have google a lot, but couldn't fix this error.

Gone through these links:

https://www.daniweb.com/programming/software-development/threads/274651/guid-should-contain-32-digits-with-4-dashes-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

https://github.com/moozzyk/SignalR-Client-Swift/commits/master/Examples/HubSamplePhone/ViewController.swift

https://github.com/moozzyk/SignalR-Client-Swift/issues


问:
How to Set HTTP_HOST while Integration Testing via PHPUnit on multitenant Laravel app with different domain
I have a multitenant application, in which every tenant has a specific domain or subdomain.
some of these tenants like the landlord have some particular features and tools.

I've managed to initialize HTTP_HOST in PHPUnit by adding the following line:
<server name='HTTP_HOST' value='mydomain.local' />
but doing this, I must manually change the HTTP_HOST every time and re-run the tests to cover all the scenarios.

is there any way to set this dynamically?

using ->withHeaders(['HTTP_HOST' => 'mydomain.local']) won't work.


问:
How to select rows from a table allowing only m rows for a column's value?
I have a table called data with columns id, category, name, timestamp.

I want to select rows from the table where category IN ('a', 'b', 'c'), with a condition that only a maximum m number of rows from category a, m rows from category b and m rows from category c are selected and ordered by id ascending.

Sample Data:

Output: Let maximum m be 5


问:
Manage reference of multiple _com_ptr_t instances
I'm building a VC++ dll that exposes the functionality of some Hardware by its driver dll which uses COM Objects. The driver object (COMDriver) is a _com_ptr_t which encapsulates the interface that has all the hardware functions. My VC++ code exposes its functions using JNI to be used by a Java application upper in the stack,  but it has been a pain managing the objects lifetime using COM and JNI together, as I'm not the most experienced COM guy...

In the Java client, I have up to 3 threads that handle the communication to each own device. They call the VC++ dll in order to send the commands to each device.

On the VC++ dll, I want to be able to create several instances of the driver _com_ptr_t via a JNI call (let's call it openConnection) and store them in a global map that matches the JNIEnv pointer address (that maps out to the calling Java thread) to the respective driver instance (the _com_ptr_t instance), something like this:

```<code>//Maps the caller Java Thread (by JNIEnv*) to the respective driver instance.
unordered_map<uintptr_t, ICOMDriverPtr> stateMap;

JNIEXPORT jboolean JNICALL Java_openConnection(JNIEnv *env, jobject jobj){

    //This pointer is a reference to the Handler Thread that calls openConnection
    uintptr_t env_addresss = reinterpret_cast<uintptr_t>(env);

    ::CoInitialize(NULL);

    try
    {
    ICOMDriverPtr spDriver;
        // Create an instance of the driver.
    spDriver.CreateInstance(__uuidof(COMDriver));

       //do driver stuff....

       //store the mapping of JNIEnv and the driver COM smart pointer
       stateMap[env_addresss] = spDriver;
    }
    catch { //error handling

</code>```

When I make a call to this driver after initializing it via another JNI call I was doing  ICOMDriverPtr spDriver = stateMap[env_addresss]; but I have a COM error saying Invalid pointer to this newly created spDriver.

I tried working around GetInterfacePtr and tried multiple & and * operators with problems on compilation. in runtime this is what worked but still can't get a valid reference to the previously created spDriver.

From the Microsoft documentation on the _com_ptr_t class, the = operator should create a copy of the smart pointer stored in the map (on the second call). Should I detach the smart pointer on the OpenConnection call? (because I think it might be releasing the pointer after the JNI scope ends on the open connection, but I'm not sure). If someone could shed a light on how to copy and reference the COMDriver around JNI I would be much grateful, Thank you!

Body:
I'm building a VC++ dll that exposes the functionality of some Hardware by its driver dll which uses COM Objects. The driver object (COMDriver) is a _com_ptr_t which encapsulates the interface that has all the hardware functions. My VC++ code exposes its functions using JNI to be used by a Java application upper in the stack,  but it has been a pain managing the objects lifetime using COM and JNI together, as I'm not the most experienced COM guy...

In the Java client, I have up to 3 threads that handle the communication to each own device. They call the VC++ dll in order to send the commands to each device.

On the VC++ dll, I want to be able to create several instances of the driver _com_ptr_t via a JNI call (let's call it openConnection) and store them in a global map that matches the JNIEnv pointer address (that maps out to the calling Java thread) to the respective driver instance (the _com_ptr_t instance), something like this:

//Maps the caller Java Thread (by JNIEnv*) to the respective driver instance.
unordered_map<uintptr_t, ICOMDriverPtr> stateMap;

JNIEXPORT jboolean JNICALL Java_openConnection(JNIEnv *env, jobject jobj){

    //This pointer is a reference to the Handler Thread that calls openConnection
    uintptr_t env_addresss = reinterpret_cast<uintptr_t>(env);

    ::CoInitialize(NULL);

    try
    {
    ICOMDriverPtr spDriver;
        // Create an instance of the driver.
    spDriver.CreateInstance(__uuidof(COMDriver));

       //do driver stuff....

       //store the mapping of JNIEnv and the driver COM smart pointer
       stateMap[env_addresss] = spDriver;
    }
    catch { //error handling

When I make a call to this driver after initializing it via another JNI call I was doing  ICOMDriverPtr spDriver = stateMap[env_addresss]; but I have a COM error saying Invalid pointer to this newly created spDriver.

I tried working around GetInterfacePtr and tried multiple & and * operators with problems on compilation. in runtime this is what worked but still can't get a valid reference to the previously created spDriver.

From the Microsoft documentation on the _com_ptr_t class, the = operator should create a copy of the smart pointer stored in the map (on the second call). Should I detach the smart pointer on the OpenConnection call? (because I think it might be releasing the pointer after the JNI scope ends on the open connection, but I'm not sure). If someone could shed a light on how to copy and reference the COMDriver around JNI I would be much grateful, Thank you!


问:
Monitoring stacked ensemble models with vetiver
I developed a stacked ensemble model using the tidymodels workflow and I want to monitor the performance of this model from time to time using vetiver. However, it seems the stacked model object isn't supported yet.

Please see the code snippet below

```<code>library(tidymodels)
library(vetiver)
library(pins)
library(arrow)
library(tidyverse)
library(bonsai)
library(stacks)
library(lubridate)
library(magrittr)

b <- board_folder(path = "pins-r/")
model <- vetiver_pin_read(board = b, name = "dcp_ibese_truck_arrival",
                      version = "20230110T094207Z-69661")

trips <- read_parquet("../IbeseLivePosition/ml_data/data_to_monitor_model.parquet")

trips %<>%
  mutate(Date = as.Date(DateTimeReceived))

original_metrics <-
  vetiver::augment(model, new_data = trips)
</code>```

Error: No augment method for objects of class butchered_linear_stack

Body:
I developed a stacked ensemble model using the tidymodels workflow and I want to monitor the performance of this model from time to time using vetiver. However, it seems the stacked model object isn't supported yet.

Please see the code snippet below

library(tidymodels)
library(vetiver)
library(pins)
library(arrow)
library(tidyverse)
library(bonsai)
library(stacks)
library(lubridate)
library(magrittr)

b <- board_folder(path = "pins-r/")
model <- vetiver_pin_read(board = b, name = "dcp_ibese_truck_arrival",
                      version = "20230110T094207Z-69661")

trips <- read_parquet("../IbeseLivePosition/ml_data/data_to_monitor_model.parquet")

trips %<>%
  mutate(Date = as.Date(DateTimeReceived))

original_metrics <-
  vetiver::augment(model, new_data = trips)

Error: No augment method for objects of class butchered_linear_stack


问:
Trying to configure amplify to work with flutter app
I am in the process of following this tutorial: https://docs.amplify.aws/start/getting-started/add-api/q/integration/flutter/#deploy-authentication, and I am up to the part about adding the api and auth plugins. Up until this point, the app has been working correctly, however, when I follow all the steps to add the plugins, I get the following error:

Error message

I believe it is an issue with this line:
await Amplify.addPlugins([dataStorePlugin, apiPlugin, authPlugin]);

Additionally, I have tried calling the amplify configure function before adding the plugins but this doesn't work either. Here is my full configureAmplify function:

```<code>Future<void> _configureAmplify() async {
    try {
      // amplify plugins
      final dataStorePlugin =
          AmplifyDataStore(modelProvider: ModelProvider.instance);
      final apiPlugin = AmplifyAPI();
      final authPlugin = AmplifyAuthCognito();

      // add Amplify plugins and configure Amplify
      await Amplify.addPlugins([dataStorePlugin, apiPlugin, authPlugin]);
      await Amplify.configure(amplifyconfig);
    } catch (e) {
      // error handling can be improved for sure!
      // but this will be sufficient for the purposes of this tutorial
      safePrint('An error occurred while configuring Amplify: $e');
    }
  }
</code>```

It is also worth noting that I skipped the previous section in the tutorial (the auth section) since my data model does not require user authentication. Please let me know how I should approach fixing this error. Thanks.

Body:
I am in the process of following this tutorial: https://docs.amplify.aws/start/getting-started/add-api/q/integration/flutter/#deploy-authentication, and I am up to the part about adding the api and auth plugins. Up until this point, the app has been working correctly, however, when I follow all the steps to add the plugins, I get the following error:

Error message

I believe it is an issue with this line:
await Amplify.addPlugins([dataStorePlugin, apiPlugin, authPlugin]);

Additionally, I have tried calling the amplify configure function before adding the plugins but this doesn't work either. Here is my full configureAmplify function:

Future<void> _configureAmplify() async {
    try {
      // amplify plugins
      final dataStorePlugin =
          AmplifyDataStore(modelProvider: ModelProvider.instance);
      final apiPlugin = AmplifyAPI();
      final authPlugin = AmplifyAuthCognito();

      // add Amplify plugins and configure Amplify
      await Amplify.addPlugins([dataStorePlugin, apiPlugin, authPlugin]);
      await Amplify.configure(amplifyconfig);
    } catch (e) {
      // error handling can be improved for sure!
      // but this will be sufficient for the purposes of this tutorial
      safePrint('An error occurred while configuring Amplify: $e');
    }
  }

It is also worth noting that I skipped the previous section in the tutorial (the auth section) since my data model does not require user authentication. Please let me know how I should approach fixing this error. Thanks.