问:
Can AlertDialog be a png button
i wanted to change my AlertDialog  to a png button without the white box around it, currently i have set it to transparent but there is light shade behind the png.</p>
```<code>void showPopUpButton(BuildContext context) {
    showDialog(
      context: context,
      builder: (context) => AlertDialog(
        backgroundColor: Colors.transparent,
        title: IconButton(
          icon: Image.asset('lib/images/lastcard.png'),
          iconSize: 260,
</code>```

Title: Can AlertDialog be a png button

Body:
i wanted to change my AlertDialog  to a png button without the white box around it, currently i have set it to transparent but there is light shade behind the png.

void showPopUpButton(BuildContext context) {
    showDialog(
      context: context,
      builder: (context) => AlertDialog(
        backgroundColor: Colors.transparent,
        title: IconButton(
          icon: Image.asset('lib/images/lastcard.png'),
          iconSize: 260,


来源: stackexchange

问:
Get availability of variation for radio button display
This is a similar question to this (left unanswered unfortunately):
Woocommerce How to get stock availability of variation

Example page:

https://www.lockoloop.nl/devstage/product/soy-sauce-shoyu

I'm trying to change the aspect of the radio button when a variation is out of stock by adding a CSS class based on the availability of the variation.
I can see the availability is already a part of the $available_variations array (is_available => true), but I don't really know how to use this to loop through variations.
Could I add the info from $available_variations to the $terms, somehow? Or fetch the availability in the foreach $terms loop?

This is the $terms var_dump:

```<code>array(2) {
    [0]=> object(WP_Term)-4941 (10) {
        ["term_id"]=> int(65)
        ["name"]=> string(6) "580 ml"
        ["slug"]=> string(3) "580"
        ["term_group"]=> int(0)
        ["term_taxonomy_id"]=> int(65)
        ["taxonomy"]=> string(9) "pa_volume"
        ["description"]=> string(0) ""
        ["parent"]=> int(0)
        ["count"]=> int(37)
        ["filter"]=> string(3) "raw"
        }

    [1]=> object(WP_Term)-3568 (10) {
        ["term_id"]=> etc
        [...]}
    }
</code>```

Here the $available_variations (removed unnecessary chunks, but kept the structure - I would actually also like to display the weight on the label):

```<code>array(2) {
  [0]=>  array(24) {
    ["attributes"]=>    array(1) {
        ["attribute_pa_volume"]=> string(3) "580"
    }
    ["is_in_stock"]=>    bool(true)
    ["weight_html"]=>    string(5) "580 g"
    [...]
  }

  [1]=>  array(24) {
    ["attributes"]=>    array(1) {
        ["attribute_pa_volume"]=> string(4) "1062"
    }
    ["is_in_stock"]=>    bool(false)
    ["weight_html"]=>    string(6) "1060 g"
    [...]
  }
}
</code>```

Here is the variable.php file that is being overwritten, the interesting part happens in the div "value" (with $available_variations being set earlier).

```<code><form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo htmlspecialchars( wp_json_encode( $available_variations ) ) ?>">
    <?php do_action( 'woocommerce_before_variations_form' ); ?>
    <?php if ( empty( $available_variations ) && false !== $available_variations ) : ?>
        <p class="stock out-of-stock"><?php esc_html_e( 'This product is currently out of stock and unavailable.', 'woocommerce' ); ?></p>
    <?php else : ?>
        <div class="variations">
                <?php foreach ( $attributes as $name => $options ) : ?>
                    <?php $sanitized_name = sanitize_title( $name ); ?>
                    <div class="attribute-<?php echo esc_attr( $sanitized_name ); ?>">
                        <?php
                        if ( isset( $_REQUEST[ 'attribute_' . $sanitized_name ] ) ) {
                            $checked_value = $_REQUEST[ 'attribute_' . $sanitized_name ];
                        } elseif ( isset( $selected_attributes[ $sanitized_name ] ) ) {
                            $checked_value = $selected_attributes[ $sanitized_name ];
                        } else {
                            $checked_value = '';
                        }
                        ?>
                        <div class="value">
                            <?php
                            if ( ! empty( $options ) ) {
                                if ( taxonomy_exists( $name ) ) {
                                    // Get terms if this is a taxonomy - ordered. We need the names too.
                                    $terms = wc_get_product_terms( $product->get_id(), $name, array( 'fields' => 'all' ) );

                                    foreach ( $terms as $term ) {
                                        if ( ! in_array( $term->slug, $options ) ) {
                                            continue;
                                        }
                                        print_attribute_radio( $checked_value, $term->slug, $term->name, $sanitized_name );
                                    }
                                } else {
                                    foreach ( $options as $option ) {
                                        print_attribute_radio( $checked_value, $option, $option, $sanitized_name );
                                    }
                                }
                            }

                            /*echo end( $attribute_keys ) === $name ? wp_kses_post( apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . esc_html__( 'Clear', 'woocommerce' ) . '</a>' ) ) : '';*/
                            ?>
                        </div>
                    </div>
                <?php endforeach; ?>
        </div>

        <?php
            if ( version_compare($woocommerce->version, '3.4.0') < 0 ) {
                do_action( 'woocommerce_before_add_to_cart_button' );
            }
        ?>

        <div class="single_variation_wrap">
            <?php
                do_action( 'woocommerce_before_single_variation' );
                do_action( 'woocommerce_single_variation' );
                do_action( 'woocommerce_after_single_variation' );
            ?>
        </div>

        <?php
            if ( version_compare($woocommerce->version, '3.4.0') < 0 ) {
                do_action( 'woocommerce_after_add_to_cart_button' );
            }
        ?>
    <?php endif; ?>

    <?php do_action( 'woocommerce_after_variations_form' ); ?>
</form>
</code>```

The actual radio display:

```<code>function print_attribute_radio( $checked_value, $value, $label, $name ) {
            global $product;

            $availability = 'sold-out';
            $input_name = 'attribute_' . esc_attr( $name ) ;
            $esc_value = esc_attr( $value );
            $id = esc_attr( $name . '_v_' . $value . $product->get_id() );
            $checked = checked( $checked_value, $value, false );
            $filtered_label = apply_filters( 'woocommerce_variation_option_name', $label, esc_attr( $name ) );
            printf( '<div><input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s><label for="%3$s" class="checkmark %6$s">%5$s</label></div>', $input_name, $esc_value, $id, $checked, $filtered_label, $availability );
        }
</code>```

(Original code from https://github.com/8manos/wc-variations-radio-buttons)

Thank you!

ContentLicense: CC BY-SA 4.0

Body:
This is a similar question to this (left unanswered unfortunately):
Woocommerce How to get stock availability of variation

Example page:

https://www.lockoloop.nl/devstage/product/soy-sauce-shoyu

I'm trying to change the aspect of the radio button when a variation is out of stock by adding a CSS class based on the availability of the variation.
I can see the availability is already a part of the $available_variations array (is_available => true), but I don't really know how to use this to loop through variations.
Could I add the info from $available_variations to the $terms, somehow? Or fetch the availability in the foreach $terms loop?

This is the $terms var_dump:

array(2) {
    [0]=> object(WP_Term)-4941 (10) {
        ["term_id"]=> int(65)
        ["name"]=> string(6) "580 ml"
        ["slug"]=> string(3) "580"
        ["term_group"]=> int(0)
        ["term_taxonomy_id"]=> int(65)
        ["taxonomy"]=> string(9) "pa_volume"
        ["description"]=> string(0) ""
        ["parent"]=> int(0)
        ["count"]=> int(37)
        ["filter"]=> string(3) "raw"
        }

    [1]=> object(WP_Term)-3568 (10) {
        ["term_id"]=> etc
        [...]}
    }

Here the $available_variations (removed unnecessary chunks, but kept the structure - I would actually also like to display the weight on the label):

array(2) {
  [0]=>  array(24) {
    ["attributes"]=>    array(1) {
        ["attribute_pa_volume"]=> string(3) "580"
    }
    ["is_in_stock"]=>    bool(true)
    ["weight_html"]=>    string(5) "580 g"
    [...]
  }

  [1]=>  array(24) {
    ["attributes"]=>    array(1) {
        ["attribute_pa_volume"]=> string(4) "1062"
    }
    ["is_in_stock"]=>    bool(false)
    ["weight_html"]=>    string(6) "1060 g"
    [...]
  }
}

Here is the variable.php file that is being overwritten, the interesting part happens in the div "value" (with $available_variations being set earlier).

<form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo htmlspecialchars( wp_json_encode( $available_variations ) ) ?>">
    <?php do_action( 'woocommerce_before_variations_form' ); ?>
    <?php if ( empty( $available_variations ) && false !== $available_variations ) : ?>

<?php esc_html_e( 'This product is currently out of stock and unavailable.', 'woocommerce' ); ?>

    <?php else : ?>

                <?php foreach ( $attributes as $name => $options ) : ?>
                    <?php $sanitized_name = sanitize_title( $name ); ?>
                    <div class="attribute-<?php echo esc_attr( $sanitized_name ); ?>">
                        <?php
                        if ( isset( $_REQUEST[ 'attribute_' . $sanitized_name ] ) ) {
                            $checked_value = $_REQUEST[ 'attribute_' . $sanitized_name ];
                        } elseif ( isset( $selected_attributes[ $sanitized_name ] ) ) {
                            $checked_value = $selected_attributes[ $sanitized_name ];
                        } else {
                            $checked_value = '';
                        }
                        ?>

                            <?php
                            if ( ! empty( $options ) ) {
                                if ( taxonomy_exists( $name ) ) {
                                    // Get terms if this is a taxonomy - ordered. We need the names too.
                                    $terms = wc_get_product_terms( $product->get_id(), $name, array( 'fields' => 'all' ) );

                                    foreach ( $terms as $term ) {
                                        if ( ! in_array( $term->slug, $options ) ) {
                                            continue;
                                        }
                                        print_attribute_radio( $checked_value, $term->slug, $term->name, $sanitized_name );
                                    }
                                } else {
                                    foreach ( $options as $option ) {
                                        print_attribute_radio( $checked_value, $option, $option, $sanitized_name );
                                    }
                                }
                            }

                            /*echo end( $attribute_keys ) === $name ? wp_kses_post( apply_filters( 'woocommerce_reset_variations_link', '' . esc_html__( 'Clear', 'woocommerce' ) . '' ) ) : '';*/
                            ?>

                <?php endforeach; ?>

        <?php
            if ( version_compare($woocommerce->version, '3.4.0') < 0 ) {
                do_action( 'woocommerce_before_add_to_cart_button' );
            }
        ?>

            <?php
                do_action( 'woocommerce_before_single_variation' );
                do_action( 'woocommerce_single_variation' );
                do_action( 'woocommerce_after_single_variation' );
            ?>

        <?php
            if ( version_compare($woocommerce->version, '3.4.0') < 0 ) {
                do_action( 'woocommerce_after_add_to_cart_button' );
            }
        ?>
    <?php endif; ?>

    <?php do_action( 'woocommerce_after_variations_form' ); ?>
</form>

The actual radio display:

function print_attribute_radio( $checked_value, $value, $label, $name ) {
            global $product;

            $availability = 'sold-out';
            $input_name = 'attribute_' . esc_attr( $name ) ;
            $esc_value = esc_attr( $value );
            $id = esc_attr( $name . '_v_' . $value . $product->get_id() );
            $checked = checked( $checked_value, $value, false );
            $filtered_label = apply_filters( 'woocommerce_variation_option_name', $label, esc_attr( $name ) );
            printf( '
<input type="radio" name="%1$s" value="%2$s" id="%3$s" %4$s>%5$s
', $input_name, $esc_value, $id, $checked, $filtered_label, $availability );
        }

(Original code from https://github.com/8manos/wc-variations-radio-buttons)

Thank you!


问:
Unit testing with react-admin
I am having a hard time get the tests passed for my simple react-admin application which renders a header text on screen. Need HELP

Here is the component that renders text on screen

```<code>export const PostCreate = () => {
    return (
        <Create>
            <SimpleForm>
                <Typography
                    variant="h6"
                    sx={{
                        p: 2,
                        alignSelf: "center",
                        color: "rgb(77, 77, 77)",
                        fontFamily: "Poppins",
                        fontWeight: "600",
                        fontSize: "h5.fontSize",
                    }}
                >
                    Create Post
                </Typography>
            </SimpleForm>
        </Create>
    );
};
</code>```

Here is the test suite that checks if Create Post is rendered on screen

```<code>render(
  <AdminContext>
    <PostCreate {...defaultProps} />
  </AdminContext>
);
expect(screen.getByText("Create Post")).toBeInTheDocument();
</code>```

When I run yarn test test is failing with error Error: Uncaught [TypeError: Cannot read property 'toLowerCase' of undefined]
Please help to resolve this issue

Title: Unit testing with react-admin

Body:
I am having a hard time get the tests passed for my simple react-admin application which renders a header text on screen. Need HELP

Here is the component that renders text on screen

export const PostCreate = () => {
    return (
        <Create>
            <SimpleForm>
                <Typography
                    variant="h6"
                    sx={{
                        p: 2,
                        alignSelf: "center",
                        color: "rgb(77, 77, 77)",
                        fontFamily: "Poppins",
                        fontWeight: "600",
                        fontSize: "h5.fontSize",
                    }}
                >
                    Create Post
                </Typography>
            </SimpleForm>
        </Create>
    );
};

Here is the test suite that checks if Create Post is rendered on screen

render(
  <AdminContext>
    <PostCreate {...defaultProps} />
  </AdminContext>
);
expect(screen.getByText("Create Post")).toBeInTheDocument();

When I run yarn test test is failing with error Error: Uncaught [TypeError: Cannot read property 'toLowerCase' of undefined]
Please help to resolve this issue


问:
Batch python script sending success/failure status to promtheus
What would be the best way to send success/failure status to prometheus from a batch python script?

I have a lot of python scripts and I want to do this for each with minimal manual editing of these scripts and didn't know if someone had already came up with a common solution to handle this.

I researched using the prometheus client library and integrating that with either pushgateway or textfile collector but want a common way to mitigate manual editing of these already running batch jobs.


问:
OpenCV error: not able to link the opencv library files
enter image description here

I have tried linking the libraries. But it didnt work out.
Any help would be appreciated


问:
ALB Ingress Return fixed response 503 not pointing to my services
Hello im new to kubernetes ,  just want to ask why my ALB Ingress not pointing to my services when access through url , it just return fix response 503

This is my ingress.yaml

```<code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: "shortenurl-ingress"
  namespace: "shortenurl-ingress"
  labels:
    app: shortenurl-ingress
  annotations:
    alb.ingress.kubernetes.io/backend-protocol: HTTP
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/load-balancer-name: shortenurl-ingress
    alb.ingress.kubernetes.io/security-groups: eks-cluster-sg-shortener-eks-895573458
    alb.ingress.kubernetes.io/target-type: instance
    alb.ingress.kubernetes.io/inbound-cidrs: 0.0.0.0/0
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    external-dns.alpha.kubernetes.io/hostname: fuadariqoh.com

spec:
  ingressClassName: alb
  rules:
    - host: fuadariqoh.com
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: shortenerapp
                port:
                  number: 31674

</code>```

this is my service.yaml

```<code>apiVersion: v1
kind: Service
metadata:
  name: shortenerapp
  labels:
    app: shortenerapp
spec:
  type: NodePort
  selector:
    app: shortenurl-app
  ports:
    - port: 31674
      targetPort: 5001
      protocol: TCP

</code>```

this is my deployment.yaml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: shortenurl-app
  labels:
    app: shortenurl-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: shortenurl-app
  template:
    metadata:
      labels:
        app: shortenurl-app
    spec:
      containers:
        - name: shortenurl-app
          image: imageUri
          ports:
            - containerPort: 5001

</code>```

this is my
load balancer on aws

I cant figure out what i do wrong, any help is appreciated , Thank you.

Body:
Hello im new to kubernetes ,  just want to ask why my ALB Ingress not pointing to my services when access through url , it just return fix response 503

This is my ingress.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: "shortenurl-ingress"
  namespace: "shortenurl-ingress"
  labels:
    app: shortenurl-ingress
  annotations:
    alb.ingress.kubernetes.io/backend-protocol: HTTP
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/load-balancer-name: shortenurl-ingress
    alb.ingress.kubernetes.io/security-groups: eks-cluster-sg-shortener-eks-895573458
    alb.ingress.kubernetes.io/target-type: instance
    alb.ingress.kubernetes.io/inbound-cidrs: 0.0.0.0/0
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    external-dns.alpha.kubernetes.io/hostname: fuadariqoh.com

spec:
  ingressClassName: alb
  rules:
    - host: fuadariqoh.com
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: shortenerapp
                port:
                  number: 31674

this is my service.yaml

apiVersion: v1
kind: Service
metadata:
  name: shortenerapp
  labels:
    app: shortenerapp
spec:
  type: NodePort
  selector:
    app: shortenurl-app
  ports:
    - port: 31674
      targetPort: 5001
      protocol: TCP

this is my deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: shortenurl-app
  labels:
    app: shortenurl-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: shortenurl-app
  template:
    metadata:
      labels:
        app: shortenurl-app
    spec:
      containers:
        - name: shortenurl-app
          image: imageUri
          ports:
            - containerPort: 5001

this is my
load balancer on aws

I cant figure out what i do wrong, any help is appreciated , Thank you.


问:
Performance Issue of React Native Calendar
how can i fast React Native calendar and why Agenda gave Virtualization update?

I try agenda of react native calendar. While running app on my device it shows Virtualization update.


问:
Obtaining Suboptimal Solutions with Benders in GAMS
I have the following Benders code for a maximization problem on GAMS. It happens that sometimes GAMS give an suboptimal solution even though it should find the exact solution, since no heuristics exist and Benders tolerance (BdTol= Upper Bound - Lower Bound) is 0. I ensure that both the subproblem and the master problem are solved to optimality and optcr and optca values are taken as 0, too. I realized it as follows: for a dataset I solved the problem without enforcing any variable to take any value, and it provided an objective value. Then, I enforced a variable to take a certain value, and it provided a higher objective value. Shouldn't GAMS find the highest possible value automatically as it is a maximization problem? Do you think there is something wrong with the code?

```<code>Sets
i   /1*100/
j   /1*10/;

Parameters
p /4/
m /1/
BdTol /0/;

Table a(i,j) DATA;

Table b(i,j) DATA;

variables
q 'cut set variable'
z;

binary variables
y(j)
x(i,j);

positive variables
w(j);

scalar UB 'upperbound' /INF/;
scalar LB 'lowerbound' /-INF/;

set iter /iter1*iter1000000/;

set cutset(iter) 'dynamic set';
cutset(iter)=no;

variable z0 'relaxed master objective variable'
q 'cut set variable';

parameters
cutcoeff(iter,i,j);

*---------------------------------------------------------------------
* Benders Algorithm
*---------------------------------------------------------------------
loop(iter$((abs(UB-LB)> BdTol)),
         option lp=CPLEX, optcr=0, optca=0, reslim=1000000, iterlim=1000000;
         solve subproblem maximizing z using lp;
         abort$(subproblem.modelstat>=2) "Subproblem not solved to optimality";
         cutset(iter) = yes;
         cutcoeff(iter,i,j) = b(i,j)*w.l(j);
         option mip=CPLEX, optcr=0, optca=0, reslim=1000000, iterlim=1000000;
         solve master maximizing z0 using mip;
         abort$(master.modelstat>=2) "Masterproblem not solved to optimality";
         UB = min(UB, sum((i,j),a(i,j)*x.l(i,j))+q.l);
         LB = max(LB, sum((i,j),a(i,j)*x.l(i,j))+z.l);
         display x.l, y.l, z0.l, w.l, UB, LB;
);
</code>```

Since I believe the problem is related to the algorithm, I only share that part.

Edit: New information are added.

What really interesting is, it finds suboptimal solutions only for some instances, not all the time.

The runs for a dataset is given below. The upper ones does not involve any enforcing constraints for a variable to take a certain value. The lower one involves a single variable to take a specific value.

The following is the log output for the one without the enforced variable.

```<code>IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :         -12.203660

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.895
--- benders3.gms(358) 88 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter1
---   4,107 rows  4,016 columns  9,820 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.902

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3387 rows and 3387 columns.
Reduced MIP has 720 rows, 629 columns, and 1867 nonzeros.
Reduced MIP has 629 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Presolve time =    0.00 sec.
Found feasible solution after 0.00 sec.  Objective = 0.0000
Probing time =    0.00 sec.
Clique table members: 719.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           362.425771
Iteration:   129   Dual objective     =            96.848559
Iteration:   198   Dual objective     =            94.968744
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                            0.0000                    249     ---
*     0     0      integral     0       93.1164       93.1164      249    0.00%
Elapsed real time =   0.00 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.00
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.00 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4107 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           93.116376    (249 iterations, 0 nodes)
Final Solve:            93.116376    (0 iterations)

Best possible:          93.116376
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.954
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter2
---   12 rows  11 columns  25 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.959

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :          -2.121247

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.974
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter2
---   4,108 rows  4,016 columns  9,863 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.982

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3354 rows and 3354 columns.
Reduced MIP has 754 rows, 662 columns, and 2034 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Reduced MIP has 754 rows, 662 columns, and 2034 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.09 sec.
Found feasible solution after 0.09 sec.  Objective = -13.6132
Probing time =    0.00 sec.
Clique table members: 751.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           365.039800
Iteration:   141   Dual objective     =            96.728338
Iteration:   211   Dual objective     =            94.098252
Root relaxation solution time =    0.01 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                          -13.6132                    246     ---
*     0     0      integral     0       93.0748       93.0748      246    0.00%
Elapsed real time =   0.11 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.01
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.01 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4108 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           93.074808    (246 iterations, 0 nodes)
Final Solve:            93.074808    (0 iterations)

Best possible:          93.074808
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:05.115
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter3
---   12 rows  11 columns  25 non-zeroes
--- Executing CPLEX: elapsed 0:00:05.120

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :          -2.847644

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:05.132
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter3
---   4,109 rows  4,016 columns  9,967 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:05.141

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3354 rows and 3354 columns.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.00 sec.
Found feasible solution after 0.00 sec.  Objective = -32.0161
Probing time =    0.00 sec.
Clique table members: 751.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           346.636915
Iteration:   142   Dual objective     =            96.564506
Iteration:   214   Dual objective     =            93.644333
Root relaxation solution time =    0.02 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                          -32.0161                    252     ---
*     0     0      integral     0       92.6192       92.6192      252    0.00%
Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.09
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.09 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4109 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.01 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.619154    (252 iterations, 0 nodes)
Final Solve:            92.619154    (0 iterations)

Best possible:          92.619154
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:05.283
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter4
---   12 rows  11 columns  24 non-zeroes
--- Executing CPLEX: elapsed 0:00:05.290

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :           0.000000

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:05.304
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter4
---   4,110 rows  4,016 columns  10,038 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:05.311

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3355 rows and 3354 columns.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.02 sec.
Tried aggregator 1 time.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.09 sec.
Found feasible solution after 0.09 sec.  Objective = -32.0161
Probing time =    0.00 sec.
Clique table members: 751.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           346.636915
Iteration:   142   Dual objective     =            96.564506
Iteration:   214   Dual objective     =            93.644333
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                          -32.0161                    252     ---
*     0     0      integral     0       92.6192       92.6192      252    0.00%
Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.02
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.02 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4110 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.619154    (252 iterations, 0 nodes)
Final Solve:            92.619154    (0 iterations)

Best possible:          92.619154
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:05.434
--- benders3.gms(358) 89 Mb
*** Status: Normal completion
--- Job benders3.gms Stop 12/10/22 14:37:01 elapsed 0:00:05.481
</code>```

The following is the log output for the one with the enforced variable.

```<code>--- benders3.gms(151) 86 Mb
--- Starting execution: elapsed 0:00:04.400
--- benders3.gms(358) 88 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 88 Mb
--- LOOPS iter = iter1
---   12 rows  11 columns  31 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.406

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :         -12.203660

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.417
--- benders3.gms(358) 88 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter1
---   4,107 rows  4,016 columns  9,820 non-zeroes
---   1,009 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.425

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3547 rows and 3500 columns.
Reduced MIP has 560 rows, 516 columns, and 1458 nonzeros.
Reduced MIP has 516 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 2 times.
MIP Presolve eliminated 1 rows and 1 columns.
Aggregator did 1 substitutions.
Reduced MIP has 558 rows, 514 columns, and 1454 nonzeros.
Reduced MIP has 514 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.01 sec.
Found feasible solution after 0.01 sec.  Objective = 25.1590
Probing time =    0.00 sec.
Clique table members: 557.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           213.565458
Iteration:    77   Dual objective     =            96.476340
Iteration:   150   Dual objective     =            93.814763
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                           25.1590                    193     ---
*     0     0      integral     0       93.1164       93.1164      193    0.00%
Elapsed real time =   0.01 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.00
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.00 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4107 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           93.116376    (193 iterations, 0 nodes)
Final Solve:            93.116376    (0 iterations)

Best possible:          93.116376
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.551
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter2
---   12 rows  11 columns  25 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.555

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :          -2.121247

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.568
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter2
---   4,108 rows  4,016 columns  9,863 non-zeroes
---   1,009 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.576

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3460 rows and 3413 columns.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.00 sec.
Found feasible solution after 0.00 sec.  Objective = -2.6132
Probing time =    0.00 sec.
Clique table members: 645.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           339.579984
Iteration:   130   Dual objective     =            96.654157
Iteration:   208   Dual objective     =            93.001859
Root relaxation solution time =    0.09 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                           -2.6132                    213     ---
*     0     0      integral     0       92.8258       92.8258      213    0.00%
Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.09
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.09 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4108 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.825775    (213 iterations, 0 nodes)
Final Solve:            92.825775    (0 iterations)

Best possible:          92.825775
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.703
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter3
---   12 rows  11 columns  24 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.707

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :           0.000000

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.720
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter3
---   4,109 rows  4,016 columns  9,901 non-zeroes
---   1,009 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.727

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3461 rows and 3413 columns.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.01 sec.
Tried aggregator 1 time.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.09 sec.
Found feasible solution after 0.09 sec.  Objective = -2.6132
Probing time =    0.00 sec.
Clique table members: 645.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           339.579984
Iteration:   130   Dual objective     =            96.654157
Iteration:   208   Dual objective     =            93.001859
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                           -2.6132                    213     ---
*     0     0      integral     0       92.8258       92.8258      213    0.00%
Elapsed real time =   0.11 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.02
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.02 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4109 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.825775    (213 iterations, 0 nodes)
Final Solve:            92.825775    (0 iterations)

Best possible:          92.825775
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.861
--- benders3.gms(358) 89 Mb
*** Status: Normal completion
--- Job benders3.gms Stop 12/10/22 14:25:56 elapsed 0:00:04.910
</code>```

Body:
I have the following Benders code for a maximization problem on GAMS. It happens that sometimes GAMS give an suboptimal solution even though it should find the exact solution, since no heuristics exist and Benders tolerance (BdTol= Upper Bound - Lower Bound) is 0. I ensure that both the subproblem and the master problem are solved to optimality and optcr and optca values are taken as 0, too. I realized it as follows: for a dataset I solved the problem without enforcing any variable to take any value, and it provided an objective value. Then, I enforced a variable to take a certain value, and it provided a higher objective value. Shouldn't GAMS find the highest possible value automatically as it is a maximization problem? Do you think there is something wrong with the code?

Sets
i   /1*100/
j   /1*10/;

Parameters
p /4/
m /1/
BdTol /0/;

Table a(i,j) DATA;

Table b(i,j) DATA;

variables
q 'cut set variable'
z;

binary variables
y(j)
x(i,j);

positive variables
w(j);

scalar UB 'upperbound' /INF/;
scalar LB 'lowerbound' /-INF/;

set iter /iter1*iter1000000/;

set cutset(iter) 'dynamic set';
cutset(iter)=no;

variable z0 'relaxed master objective variable'
q 'cut set variable';

parameters
cutcoeff(iter,i,j);

*---------------------------------------------------------------------
* Benders Algorithm
*---------------------------------------------------------------------
loop(iter$((abs(UB-LB)> BdTol)),
         option lp=CPLEX, optcr=0, optca=0, reslim=1000000, iterlim=1000000;
         solve subproblem maximizing z using lp;
         abort$(subproblem.modelstat>=2) "Subproblem not solved to optimality";
         cutset(iter) = yes;
         cutcoeff(iter,i,j) = b(i,j)*w.l(j);
         option mip=CPLEX, optcr=0, optca=0, reslim=1000000, iterlim=1000000;
         solve master maximizing z0 using mip;
         abort$(master.modelstat>=2) "Masterproblem not solved to optimality";
         UB = min(UB, sum((i,j),a(i,j)*x.l(i,j))+q.l);
         LB = max(LB, sum((i,j),a(i,j)*x.l(i,j))+z.l);
         display x.l, y.l, z0.l, w.l, UB, LB;
);

Since I believe the problem is related to the algorithm, I only share that part.

Edit: New information are added.

What really interesting is, it finds suboptimal solutions only for some instances, not all the time.

The runs for a dataset is given below. The upper ones does not involve any enforcing constraints for a variable to take a certain value. The lower one involves a single variable to take a specific value.

The following is the log output for the one without the enforced variable.

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :         -12.203660

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.895
--- benders3.gms(358) 88 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter1
---   4,107 rows  4,016 columns  9,820 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.902

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3387 rows and 3387 columns.
Reduced MIP has 720 rows, 629 columns, and 1867 nonzeros.
Reduced MIP has 629 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Presolve time =    0.00 sec.
Found feasible solution after 0.00 sec.  Objective = 0.0000
Probing time =    0.00 sec.
Clique table members: 719.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           362.425771
Iteration:   129   Dual objective     =            96.848559
Iteration:   198   Dual objective     =            94.968744
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                            0.0000                    249     ---
*     0     0      integral     0       93.1164       93.1164      249    0.00%
Elapsed real time =   0.00 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.00
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.00 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4107 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           93.116376    (249 iterations, 0 nodes)
Final Solve:            93.116376    (0 iterations)

Best possible:          93.116376
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.954
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter2
---   12 rows  11 columns  25 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.959

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :          -2.121247

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.974
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter2
---   4,108 rows  4,016 columns  9,863 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.982

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3354 rows and 3354 columns.
Reduced MIP has 754 rows, 662 columns, and 2034 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Reduced MIP has 754 rows, 662 columns, and 2034 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.09 sec.
Found feasible solution after 0.09 sec.  Objective = -13.6132
Probing time =    0.00 sec.
Clique table members: 751.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           365.039800
Iteration:   141   Dual objective     =            96.728338
Iteration:   211   Dual objective     =            94.098252
Root relaxation solution time =    0.01 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                          -13.6132                    246     ---
*     0     0      integral     0       93.0748       93.0748      246    0.00%
Elapsed real time =   0.11 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.01
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.01 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4108 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           93.074808    (246 iterations, 0 nodes)
Final Solve:            93.074808    (0 iterations)

Best possible:          93.074808
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:05.115
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter3
---   12 rows  11 columns  25 non-zeroes
--- Executing CPLEX: elapsed 0:00:05.120

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :          -2.847644

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:05.132
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter3
---   4,109 rows  4,016 columns  9,967 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:05.141

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3354 rows and 3354 columns.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.00 sec.
Found feasible solution after 0.00 sec.  Objective = -32.0161
Probing time =    0.00 sec.
Clique table members: 751.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           346.636915
Iteration:   142   Dual objective     =            96.564506
Iteration:   214   Dual objective     =            93.644333
Root relaxation solution time =    0.02 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                          -32.0161                    252     ---
*     0     0      integral     0       92.6192       92.6192      252    0.00%
Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.09
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.09 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4109 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.01 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.619154    (252 iterations, 0 nodes)
Final Solve:            92.619154    (0 iterations)

Best possible:          92.619154
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:05.283
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter4
---   12 rows  11 columns  24 non-zeroes
--- Executing CPLEX: elapsed 0:00:05.290

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :           0.000000

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:05.304
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter4
---   4,110 rows  4,016 columns  10,038 non-zeroes
---   1,010 discrete-columns
--- Executing CPLEX: elapsed 0:00:05.311

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3355 rows and 3354 columns.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.02 sec.
Tried aggregator 1 time.
Reduced MIP has 755 rows, 662 columns, and 2105 nonzeros.
Reduced MIP has 661 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.09 sec.
Found feasible solution after 0.09 sec.  Objective = -32.0161
Probing time =    0.00 sec.
Clique table members: 751.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           346.636915
Iteration:   142   Dual objective     =            96.564506
Iteration:   214   Dual objective     =            93.644333
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                          -32.0161                    252     ---
*     0     0      integral     0       92.6192       92.6192      252    0.00%
Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.02
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.02 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4110 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.619154    (252 iterations, 0 nodes)
Final Solve:            92.619154    (0 iterations)

Best possible:          92.619154
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:05.434
--- benders3.gms(358) 89 Mb
*** Status: Normal completion
--- Job benders3.gms Stop 12/10/22 14:37:01 elapsed 0:00:05.481

The following is the log output for the one with the enforced variable.

--- benders3.gms(151) 86 Mb
--- Starting execution: elapsed 0:00:04.400
--- benders3.gms(358) 88 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 88 Mb
--- LOOPS iter = iter1
---   12 rows  11 columns  31 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.406

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :         -12.203660

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.417
--- benders3.gms(358) 88 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter1
---   4,107 rows  4,016 columns  9,820 non-zeroes
---   1,009 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.425

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3547 rows and 3500 columns.
Reduced MIP has 560 rows, 516 columns, and 1458 nonzeros.
Reduced MIP has 516 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 2 times.
MIP Presolve eliminated 1 rows and 1 columns.
Aggregator did 1 substitutions.
Reduced MIP has 558 rows, 514 columns, and 1454 nonzeros.
Reduced MIP has 514 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.01 sec.
Found feasible solution after 0.01 sec.  Objective = 25.1590
Probing time =    0.00 sec.
Clique table members: 557.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           213.565458
Iteration:    77   Dual objective     =            96.476340
Iteration:   150   Dual objective     =            93.814763
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                           25.1590                    193     ---
*     0     0      integral     0       93.1164       93.1164      193    0.00%
Elapsed real time =   0.01 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.00
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.00 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4107 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           93.116376    (193 iterations, 0 nodes)
Final Solve:            93.116376    (0 iterations)

Best possible:          93.116376
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.551
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter2
---   12 rows  11 columns  25 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.555

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :          -2.121247

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.568
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter2
---   4,108 rows  4,016 columns  9,863 non-zeroes
---   1,009 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.576

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3460 rows and 3413 columns.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.00 sec.
Tried aggregator 1 time.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.00 sec.
Found feasible solution after 0.00 sec.  Objective = -2.6132
Probing time =    0.00 sec.
Clique table members: 645.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           339.579984
Iteration:   130   Dual objective     =            96.654157
Iteration:   208   Dual objective     =            93.001859
Root relaxation solution time =    0.09 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                           -2.6132                    213     ---
*     0     0      integral     0       92.8258       92.8258      213    0.00%
Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.09
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.09 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4108 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.825775    (213 iterations, 0 nodes)
Final Solve:            92.825775    (0 iterations)

Best possible:          92.825775
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.703
--- benders3.gms(358) 89 Mb
--- Generating LP model subproblem
--- benders3.gms(360) 89 Mb
--- LOOPS iter = iter3
---   12 rows  11 columns  24 non-zeroes
--- Executing CPLEX: elapsed 0:00:04.707

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 12 rows and 11 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
LP status(1): optimal

Optimal solution found.
Objective :           0.000000

--- Reading solution for model subproblem
--- Executing after solve: elapsed 0:00:04.720
--- benders3.gms(358) 89 Mb
--- Generating MIP model master
--- benders3.gms(367) 89 Mb
--- LOOPS iter = iter3
---   4,109 rows  4,016 columns  9,901 non-zeroes
---   1,009 discrete-columns
--- Executing CPLEX: elapsed 0:00:04.727

IBM ILOG CPLEX   Jul  4, 2012 23.9.5 WEX 36376.36401 WEI x86_64/MS Windows
--- GAMS/Cplex licensed for continuous and discrete problems.
Cplex 12.4.0.1

Reading data...
Starting Cplex...
Tried aggregator 1 time.
MIP Presolve eliminated 3461 rows and 3413 columns.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Probing time =    0.01 sec.
Tried aggregator 1 time.
Reduced MIP has 648 rows, 603 columns, and 1781 nonzeros.
Reduced MIP has 602 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time =    0.09 sec.
Found feasible solution after 0.09 sec.  Objective = -2.6132
Probing time =    0.00 sec.
Clique table members: 645.
MIP emphasis: balance optimality and feasibility.
MIP search method: dynamic search.
Parallel mode: none, using 1 thread.
Tried aggregator 1 time.
No LP presolve or aggregator reductions.
Presolve time =    0.00 sec.
Initializing dual steep norms . . .

Iteration log . . .
Iteration:     1   Dual objective     =           339.579984
Iteration:   130   Dual objective     =            96.654157
Iteration:   208   Dual objective     =            93.001859
Root relaxation solution time =    0.00 sec.

        Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

*     0+    0                           -2.6132                    213     ---
*     0     0      integral     0       92.8258       92.8258      213    0.00%
Elapsed real time =   0.11 sec. (tree size =  0.00 MB, solutions = 2)

Root node processing (before b&c):
  Real time             =    0.02
Sequential b&c:
  Real time             =    0.00
                          -------
Total (root+branch&cut) =    0.02 sec.
MIP status(101): integer optimal solution
Fixing integer variables, and solving final LP...
Tried aggregator 1 time.
LP Presolve eliminated 4109 rows and 4016 columns.
All rows and columns eliminated.
Presolve time =    0.00 sec.
Fixed MIP status(1): optimal

Proven optimal solution.

MIP Solution:           92.825775    (213 iterations, 0 nodes)
Final Solve:            92.825775    (0 iterations)

Best possible:          92.825775
Absolute gap:            0.000000
Relative gap:            0.000000

--- Reading solution for model master
--- Executing after solve: elapsed 0:00:04.861
--- benders3.gms(358) 89 Mb
*** Status: Normal completion
--- Job benders3.gms Stop 12/10/22 14:25:56 elapsed 0:00:04.910


问:
nmcli Error: Connection activation failed: Not authorized to control networking
I wrote a combination .sh and .exp scripts that:

activate vpn connection

connect to remote server

download some files from server

deactivate vpn connection

This scripts should run on schedule.
I use nmcli for activate and deactivate connections.
If I run scripts manually it work correctly, but if I run this scripts via cron, I receive message (about vpn conn activation): Error: Connection activation failed: Not authorized to control networking.

In logs I see that the script is run from under me:

```<code>Dec  6 18:48:01 maskalev-Aspire-A514-54 CRON[10975]: (maskalev) CMD (./dev/promomed/__DRAFTS__/utils/sftp_monitor/main.sh)
</code>```

my groups:

```<code>maskalev@maskalev-Aspire-A514-54:~$ groups
maskalev root adm cdrom sudo dip plugdev netdev lpadmin lxd sambashare docker
</code>```

nmcli permissions

```<code>maskalev@maskalev-Aspire-A514-54:~$ nmcli general permissions
PERMISSION                                                        VALUE
org.freedesktop.NetworkManager.checkpoint-rollback                auth
org.freedesktop.NetworkManager.enable-disable-connectivity-check  yes
org.freedesktop.NetworkManager.enable-disable-network             yes
org.freedesktop.NetworkManager.enable-disable-statistics          yes
org.freedesktop.NetworkManager.enable-disable-wifi                yes
org.freedesktop.NetworkManager.enable-disable-wimax               yes
org.freedesktop.NetworkManager.enable-disable-wwan                yes
org.freedesktop.NetworkManager.network-control                    yes
org.freedesktop.NetworkManager.reload                             auth
org.freedesktop.NetworkManager.settings.modify.global-dns         auth
org.freedesktop.NetworkManager.settings.modify.hostname           auth
org.freedesktop.NetworkManager.settings.modify.own                yes
org.freedesktop.NetworkManager.settings.modify.system             yes
org.freedesktop.NetworkManager.sleep-wake                         no
org.freedesktop.NetworkManager.wifi.scan                          yes
org.freedesktop.NetworkManager.wifi.share.open                    yes
org.freedesktop.NetworkManager.wifi.share.protected               yes
</code>```

I think I'm interested enable-disable-network, amn't?

Have you any ideas?

May be I can solve this problem (mainly activate vpn) by other way?

Body:
I wrote a combination .sh and .exp scripts that:

activate vpn connection

connect to remote server

download some files from server

deactivate vpn connection

This scripts should run on schedule.
I use nmcli for activate and deactivate connections.
If I run scripts manually it work correctly, but if I run this scripts via cron, I receive message (about vpn conn activation): Error: Connection activation failed: Not authorized to control networking.

In logs I see that the script is run from under me:

Dec  6 18:48:01 maskalev-Aspire-A514-54 CRON[10975]: (maskalev) CMD (./dev/promomed/__DRAFTS__/utils/sftp_monitor/main.sh)

my groups:

maskalev@maskalev-Aspire-A514-54:~$ groups
maskalev root adm cdrom sudo dip plugdev netdev lpadmin lxd sambashare docker

nmcli permissions

maskalev@maskalev-Aspire-A514-54:~$ nmcli general permissions
PERMISSION                                                        VALUE
org.freedesktop.NetworkManager.checkpoint-rollback                auth
org.freedesktop.NetworkManager.enable-disable-connectivity-check  yes
org.freedesktop.NetworkManager.enable-disable-network             yes
org.freedesktop.NetworkManager.enable-disable-statistics          yes
org.freedesktop.NetworkManager.enable-disable-wifi                yes
org.freedesktop.NetworkManager.enable-disable-wimax               yes
org.freedesktop.NetworkManager.enable-disable-wwan                yes
org.freedesktop.NetworkManager.network-control                    yes
org.freedesktop.NetworkManager.reload                             auth
org.freedesktop.NetworkManager.settings.modify.global-dns         auth
org.freedesktop.NetworkManager.settings.modify.hostname           auth
org.freedesktop.NetworkManager.settings.modify.own                yes
org.freedesktop.NetworkManager.settings.modify.system             yes
org.freedesktop.NetworkManager.sleep-wake                         no
org.freedesktop.NetworkManager.wifi.scan                          yes
org.freedesktop.NetworkManager.wifi.share.open                    yes
org.freedesktop.NetworkManager.wifi.share.protected               yes

I think I'm interested enable-disable-network, amn't?

Have you any ideas?

May be I can solve this problem (mainly activate vpn) by other way?


问:
C++ Video Capturing using Sink Writer - Memory consumption
I am writing a C++ program (Win64) using C++ Builder 11.1.5 that captures video from a web cam and stores the captured frames in a WMV file using the sink writer interface as described in the following tutorial:
https://learn.microsoft.com/en-gb/windows/win32/medfound/tutorial--using-the-sink-writer-to-encode-video?redirectedfrom=MSDN

The video doesn't need to be real time using 30 Frames per second as the process being recorded is a slow one so I have set the FPS to be 5 (which is fine.)

The recording needs to run for about 8-12 hours at a time and using the algorithms in the sink writer tutorial, I have seen the memory consumption of the program go up dramatically after 10 minutes of recording (in excess of 10 Gb of memory).  I also have seen that the final WMV file only becomes populated when the Finalize routine is called.  Because of the memory consumption, the program starts to slow down after a while.

First Question:  Is it possible to flush the sink writer to free up ram while it is recording?

Second Question:  Maybe it would be more efficient to save the video in pieces and finalize the recording every 10 minutes or so then start another recording using a different file name such that when 8 hours is done the program could combine all the saved WMV files?  How would one go about combining numerous WMV files into one large file?


问:
What is the best pattern to deal with async callbacks using quarkus, mutiny, kotlin?
I want to expose a synchronous API that calls an async under the hood. The async API calls my server back when the data are available on its side (if data are not available in a reasonable amount of time my API returns a 404).

I've implemented a solution based on CompletableFuture, prototyped another one using an Emitter that I store in a context that can be retrieved when the incoming callback arrives but I'm not sure to do it the right way (most simple?).

What do you think about?
Thanks in advance
Patrice

@Path("/status")
class DeviceStatusController(
    private val deviceStatusService: DeviceStatusService
) {

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    fun getStatus(@Valid @NotNull requestStatus: RequestStatus): Uni<String> {
        return deviceStatusService.getStatus(requestStatus)
    }
}

@ApplicationScoped
@Path("/notifications")
class NotificationController(val service: DeviceStatusService) {

    @POST
    fun receive(@RequestBody @Valid notification: Notification) {
        service.receive(notification)
    }
}

@ApplicationScoped
class DeviceStatusService {
    private val logger: Logger = Logger.getLogger(this.javaClass.canonicalName)

    data class UniContext(val emitter: CompletableFuture<String>)

    //Todo: Change for redis registration with TTL
    val notificationMap = mutableMapOf<String, UniContext>()

    fun getStatus(requestStatus: RequestStatus): Uni<String> {

        // Call async service here ... it will call us back on notifications endpoint
        // It will just reply ... your request is accepted

        val emitter = CompletableFuture<String>()
        notificationMap[requestStatus.device] = UniContext(emitter)
        return Uni.createFrom().completionStage(emitter.minimalCompletionStage())
            .ifNoItem().after(Duration.ofSeconds(60))
            .failWith {
                cleanContexts(requestStatus.device)
                TimeoutException("No reply for ${requestStatus.device}")
            }
    }

    fun cleanContexts(id: String) {
        notificationMap.remove(id)
    }

    fun receive(notification: Notification) {
        logger.fine("Notification received for ${notification.device}")
        notificationMap[notification.device]?.let {
            it.emitter.complete(notification.status)
            notificationMap.remove(notification.device)
        }
    }

}

```

The full sample is in my github repo

Body:
I want to expose a synchronous API that calls an async under the hood. The async API calls my server back when the data are available on its side (if data are not available in a reasonable amount of time my API returns a 404).

I've implemented a solution based on CompletableFuture, prototyped another one using an Emitter that I store in a context that can be retrieved when the incoming callback arrives but I'm not sure to do it the right way (most simple?).

What do you think about?
Thanks in advance
Patrice

@Path("/status")
class DeviceStatusController(
    private val deviceStatusService: DeviceStatusService
) {

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    fun getStatus(@Valid @NotNull requestStatus: RequestStatus): Uni<String> {
        return deviceStatusService.getStatus(requestStatus)
    }
}

@ApplicationScoped
@Path("/notifications")
class NotificationController(val service: DeviceStatusService) {

    @POST
    fun receive(@RequestBody @Valid notification: Notification) {
        service.receive(notification)
    }
}

@ApplicationScoped
class DeviceStatusService {
    private val logger: Logger = Logger.getLogger(this.javaClass.canonicalName)

    data class UniContext(val emitter: CompletableFuture<String>)

    //Todo: Change for redis registration with TTL
    val notificationMap = mutableMapOf<String, UniContext>()

    fun getStatus(requestStatus: RequestStatus): Uni<String> {

        // Call async service here ... it will call us back on notifications endpoint
        // It will just reply ... your request is accepted

        val emitter = CompletableFuture<String>()
        notificationMap[requestStatus.device] = UniContext(emitter)
        return Uni.createFrom().completionStage(emitter.minimalCompletionStage())
            .ifNoItem().after(Duration.ofSeconds(60))
            .failWith {
                cleanContexts(requestStatus.device)
                TimeoutException("No reply for ${requestStatus.device}")
            }
    }

    fun cleanContexts(id: String) {
        notificationMap.remove(id)
    }

    fun receive(notification: Notification) {
        logger.fine("Notification received for ${notification.device}")
        notificationMap[notification.device]?.let {
            it.emitter.complete(notification.status)
            notificationMap.remove(notification.device)
        }
    }

}

The full sample is in my github repo


问:
Comparing 2 pointclouds of different sizes
The aim of the program is to compare a set of 29 prior map scans to a set of 600 scans.
The prior map is made up of a 32 beam lidar, but the query scans are made up of either 16 beam lidars or 64 beam lidars.
Are there any suggestions for how to compare the beams?

When the scans are both 32-beams. The point clouds are compared using ScanContext (a method in which each element in a matrix represents a radial position relative to the robot and the value of the element is the maximum height located at that position)

My current thoughts would be to simply remove half the data so that the 64-beam looks like a 32-beam (or a 32 looks like a 16) but this seems inefficient and pointless.


问:
Local storage across subdomains?
I have two applications, app.somedomain.com and beta.subdomain.com and the access token is stored in local storage (the apps are identical). When I open the application in incognito window and log into app.somedomain.com, I am then able to open beta.somedomain.com without logging in.

What is the scope of local storage? Does it mean that local storage has scope of 2nd level domain and is shared between 3rd level domain applications?

Title: Local storage across subdomains?


问:
Pass extra command line parametes to plink in ANT CVS task
I'm trying to make plink use the private key using the commnand line -i instead of relying on pagent in a ANT CVS task.  I tried to set the cvsRsh param to "plink.exe -i my_private_key" without success. It complains that program cannot be found.

Of course i tried all sorts of quotes combination but it seems it tries to validate the path instead of just executing the cvsRsh variable.

So you have any ideas how to accomplish the same thing ?

ContentLicense: CC BY-SA 3.0


问:
Pysimplegui stucks on string input
I want to do a text input with pysimplegui which has a length of about 400.000 characters.
After pasting the string in the Input field the application stucks for 2-3 minutes, at 15-20% CPU usage, before the string is finally inside the values dict.

I don't have any idea how to solve, handle or optimize that.
The strings I have to paste into the Input are from files which have embedded PDF strings inside.
Just reading the string from the file directly is no option to solve that.

```<code>import PySimpleGUI as sg

col = [[sg.Text("content:", size=(8, 1)), sg.Input(size=(45, 1), key="-FIELD CONTENT-", enable_events=True)]]
layout = [[sg.Column(col)]]

window = sg.Window(title="Test", layout=layout, resizable=True)
while True:
   event, values = window.read()
   if event == "-FIELD CONTENT-":
      print(len(values["-FIELD CONTENT-"]))
</code>```

Some ideas?
Thanks in advance!

Title: Pysimplegui stucks on string input

Body:
I want to do a text input with pysimplegui which has a length of about 400.000 characters.
After pasting the string in the Input field the application stucks for 2-3 minutes, at 15-20% CPU usage, before the string is finally inside the values dict.

I don't have any idea how to solve, handle or optimize that.
The strings I have to paste into the Input are from files which have embedded PDF strings inside.
Just reading the string from the file directly is no option to solve that.

import PySimpleGUI as sg

col = [[sg.Text("content:", size=(8, 1)), sg.Input(size=(45, 1), key="-FIELD CONTENT-", enable_events=True)]]
layout = [[sg.Column(col)]]

window = sg.Window(title="Test", layout=layout, resizable=True)
while True:
   event, values = window.read()
   if event == "-FIELD CONTENT-":
      print(len(values["-FIELD CONTENT-"]))

Some ideas?
Thanks in advance!


问:
Node Js needs to send data multiple times
I except to do a simulation of the terminal in front and therefore to display live the messages of the sass --watch the problem is that res.render I can only do it once and what there is any way to return this multiple times?

So here my code :

```<code>app.get('/sass', function (req, res) {
  path1 = req.query.chemin;
  path2 = req.query.chemin;

  const ls = spawn('sass', ['--watch path1 path2'], { shell: true });

  ls.stdout.on('data', (data) => {

    console.log(ls.pid);
    message = JSON.stringify(`stdout: ${data}`);

    res.render('index', { messagee: message, path: firstpath });

  });

});
</code>```

Front :

  <%= messagee %>

My infrastructures :

server.js
-views
--index.ejs
-public
--css
--js
--img

Thank you for your answer

Body:
I except to do a simulation of the terminal in front and therefore to display live the messages of the sass --watch the problem is that res.render I can only do it once and what there is any way to return this multiple times?

So here my code :

app.get('/sass', function (req, res) {
  path1 = req.query.chemin;
  path2 = req.query.chemin;

  const ls = spawn('sass', ['--watch path1 path2'], { shell: true });

  ls.stdout.on('data', (data) => {

    console.log(ls.pid);
    message = JSON.stringify(`stdout: ${data}`);

    res.render('index', { messagee: message, path: firstpath });

  });

});

Front :

  <%= messagee %>

My infrastructures :

server.js
-views
--index.ejs
-public
--css
--js
--img

Thank you for your answer


问:
How to write a new callback function with transformers-huggingface?
I want to define a specific callback function each time my gpt-2 fine tuned model finishes an epoch of training. To do this, I specified the callback parameter in the call to the trainer class :

```<code>trainer = Trainer(
    model=model,
    args=training_args,
    data_collator=data_collator,
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
    callbacks=[my_callback]
)
</code>```

And I wrote a callback function that tests output generated by current epoch model

```<code>class my_callback(TrainerCallback):
    def on_epoch_end(self, args: TrainingArguments, state: TrainerState):
        print("The epoch has ended.")
</code>```

It doesnt print anything at the end of the epoch

Body:
I want to define a specific callback function each time my gpt-2 fine tuned model finishes an epoch of training. To do this, I specified the callback parameter in the call to the trainer class :

trainer = Trainer(
    model=model,
    args=training_args,
    data_collator=data_collator,
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
    callbacks=[my_callback]
)

And I wrote a callback function that tests output generated by current epoch model

class my_callback(TrainerCallback):
    def on_epoch_end(self, args: TrainingArguments, state: TrainerState):
        print("The epoch has ended.")

It doesnt print anything at the end of the epoch


问:
How to download only desired entry rows from Eland (Elasticsearch python+pandas client)?
Currently, if I want to create a dataframe with specific entries from an index, using Eland, I must first download a dataframe with all the entries, and then filter them out, locally... this is hardly desirable in terms of CPU and RAM local usage. Is there a way to push the filtering to the ES nodes instead, and simply download the already filtered dataframe?

https://eland.readthedocs.io/en/v8.0.0/reference/api/eland.DataFrame.html#eland.DataFrame


问:
tradingview widget real-time chart change price
I am using tradingview widget with javascript. When the page loads, BTCUSDT is the USDT equivalent. In the upper right corner, we can change the currency of a different country from the price conversion. Is it possible to select different country automatically with widget settings on code??

```<code><script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
                    <script type="text/javascript">
                        new TradingView.widget({
                            "width": "100%",
                            "height": "100%",
                            "symbol": "<?php echo $pairname; ?>USDT",
                            "interval": "D",
                            "timezone": "Etc/UTC",
                            "theme": "dark",
                            "style": "1",
                            "locale": "tr",
                            "currencies": "KWD",
                            "toolbar_bg": "#f1f3f6",
                            "enable_publishing": false,
                            "allow_symbol_change": true,
                            "container_id": "tradingview_b75ce"
                        });
                    </script>
</code>```


问:
Display RSS source in Firefox
For some reasons, Firefox doesn't display rss feed source, it downloads it by default.
A trick is to manually add "view-source:" before the feed url but it's...manual.
Is there any workaround/extension to display rss feed source instead of download it?</p>

Title: Display RSS source in Firefox


问:
Puppeteer  tag click
First of all, good work everyone. I'm pulling data from a site using Puppeteer, after the data extraction process is finished, I want to move on to the next page. For this, there is an  tag as below.

```<code>

<a class="paginate_button next" aria-controls="empTable" data-dt-idx="7" tabindex="0" id="empTable_next">Next</a>
</code>```

The codes I'm trying to click are as follows

```<code>WaitUntilNavigation[] waitUntilNavigations = new WaitUntilNavigation[1]; waitUntilNavigations[0] = WaitUntilNavigation.DOMContentLoaded; await page.GoToAsync(url,new NavigationOptions { WaitUntil = waitUntilNavigations });

await page.ClickAsync("a#empTable_next");
</code>```

I'm sure I'm on the right page but I'm getting the following error.

```<code>PuppeteerSharp.SelectorException: No node found for selector:
a#empTable_next
</code>```

I need your help.

Title: Puppeteer <a> tag click

Body:
First of all, good work everyone. I'm pulling data from a site using Puppeteer, after the data extraction process is finished, I want to move on to the next page. For this, there is an  tag as below.

Next

The codes I'm trying to click are as follows

WaitUntilNavigation[] waitUntilNavigations = new WaitUntilNavigation[1]; waitUntilNavigations[0] = WaitUntilNavigation.DOMContentLoaded; await page.GoToAsync(url,new NavigationOptions { WaitUntil = waitUntilNavigations });

await page.ClickAsync("a#empTable_next");

I'm sure I'm on the right page but I'm getting the following error.

PuppeteerSharp.SelectorException: No node found for selector:
a#empTable_next

I need your help.


问:
ROI selection cv2.selectROI not working in Google Colab
I’m learning opencv for object detection and trying to do all the coding using google colab. And so far it has been working well: I can mount the gdrive and upload file and read the video file just fine.

The selecting ROI by passing video frame into cv2.selectROI() crashed the Colab. The runtime log complained about a plugin xcb not initialising. Further reading reveals the plug in require to be run on local machine, so I wonder if there is a way to run cv2.selectROI or equivalent on colab?